CSV to LaTeX table converter
Paste your results as CSV and get a LaTeX table to drop into Overleaf or any LaTeX editor.
Loading the tool…
Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.
How to use it
- Enter csv data, cell delimiter, column alignment, rule style, first row is the header and trim spaces around each cell.
- The result appears straight away and updates as you edit.
- Copy the result, or copy a link that keeps the same values to share it.
How it is calculated
Cells of each row are joined with & and the row ends with \\ inside \begin{tabular}{ll}. The characters \ & % $ # _ { } ~ ^ are escaped, for example to \&, \_ and \textbackslash{}.
Example
Inputs: Cell delimiter = Detect automatically, Column alignment = Left (l), Rule style = \hline rules, First row is the header = yes, Trim spaces around each cell = yes. Result: LaTeX code: \begin{tabular}{lll} \hline product & price & qty \\ \hline Tea & 12.5 & 3 \\ Coffee & 18 & 2 \\ Dates & 30 & 1 \\ \hline \end{tabular}; Rows: 4; Columns: 3.
product,price,qty Tea,12.5,3 Coffee,18,2 Dates,30,1
\begin{tabular}{lll}
\hline
product & price & qty \\
\hline
Tea & 12.5 & 3 \\
Coffee & 18 & 2 \\
Dates & 30 & 1 \\
\hline
\end{tabular}Limits and caveats
- The booktabs style needs \usepackage{booktabs} in the preamble.
- Arabic text needs a package such as polyglossia or babel with XeLaTeX or LuaLaTeX, which is not added for you.
- A line break inside a cell becomes a space.
Questions about this tool
Why did & become \&?
In LaTeX & separates columns, so without escaping the table would split in the wrong place.
Does the code work in Overleaf?
Yes. Paste it into your document, and wrap it in a table environment to add a \caption.
What is the difference between hline and booktabs?
booktabs uses rules of different weights with better spacing and is common in journals.
