Convert CSV, Excel or Markdown tables to LaTeX
Convert a table to LaTeX
Paste CSV or tab-separated cells copied from a spreadsheet into the converter. For a Markdown table, choose Markdown mode instead. The LaTeX output updates as you edit. Choose an environment and alignment, review the rows, then copy the code into your document.
Open the Table to LaTeX converter. The steps below use its default tabular environment with centered columns and booktabs lines.
A complete CSV-to-LaTeX example
Paste this into the CSV input:
Item,Cost,Change
A&B,$10,50%
The converter treats the cells as plain text and escapes the special characters. With tabular, center alignment and booktabs enabled, it produces:
\begin{tabular}{ccc}
\toprule
Item & Cost & Change \\
\midrule
A\&B & \$10 & 50\% \\
\bottomrule
\end{tabular}
Here is a complete document you can compile in your own LaTeX editor:
\documentclass{article}
\usepackage{booktabs}
\begin{document}
\begin{tabular}{ccc}
\toprule
Item & Cost & Change \\
\midrule
A\&B & \$10 & 50\% \\
\bottomrule
\end{tabular}
\end{document}
The booktabs package defines \toprule, \midrule and \bottomrule. If your document cannot load that package, switch booktabs off in the tool to generate \hline rules.
Paste from a spreadsheet or use Markdown
For Excel or another spreadsheet, select a rectangular range, copy it, and paste the cells into CSV mode. Spreadsheet clipboard data normally uses tabs between cells; the converter detects that format. It does not import .xlsx files directly.
CSV values containing commas must be quoted, for example:
Name,Location
Alice,"Paris, France"
For Markdown, select Markdown mode and paste a pipe-separated table:
| Name | Score |
| --- | --- |
| Alice | 95 |
| Bob | 82 |
The separator row is removed. The current Markdown parser splits on pipe characters, so cells containing literal pipes need manual cleanup. Spreadsheet cell styling, formulas and merged cells are not preserved.
Choose an environment and check the preview
- tabular produces a text table. The tool displays a browser table preview so you can check cell contents and alignment. This preview is not a LaTeX compilation and does not reproduce your document fonts, page width or every booktabs detail.
- array and the matrix environments use a math renderer for preview. In your document, place these environments in math mode. Matrix environments such as
pmatrixandbmatrixnormally require\usepackage{amsmath}. - Left, center or right alignment applies the same choice to all columns where the environment supports alignment. To mix alignments in a tabular table, edit the output, for example from
{ccc}to{lcr}.
The converter escapes every cell as text. It does not distinguish a literal value from an existing LaTeX command or formula. Add intentional math such as $x^2$ to the generated code afterward rather than expecting it to pass through unchanged. For math expressions, see the formula editor.
Fix common table problems
The table is too wide
For a text column that should wrap, change its column specification to a paragraph column such as p{4cm}. Check the result in your actual document; the browser preview does not calculate LaTeX page layout.
Rows have different numbers of cells
The converter pads shorter rows with empty cells. Check the input for a missing comma or tab before copying the output. In CSV, quote a comma that belongs inside one value.
A table needs merged cells
Merged cells require manual LaTeX editing. For a cell spanning two columns, use a command such as \multicolumn{2}{c}{Group} and adjust that row to match the table column count. Row spans use \multirow from the multirow package. Neither kind of span is generated by this converter.
Percent signs or ampersands show the wrong result
Plain cell values such as 50% and A&B are escaped automatically. Avoid pre-escaping those values in the input; existing backslashes are treated as literal text. The LaTeX escape guide explains the difference between text and syntax.
