CSV to LaTeX Table
Generate a LaTeX table from a CSV without hand-typing ampersands and double backslashes. Numeric columns are right-aligned automatically, special characters are escaped so & and % in your data don't break compilation, and you can wrap it in a float with a caption and a label ready to \ref.
How to convert CSV to LaTeX
- Paste the CSV or drop a file.
- Pick tabular for a table that fits on one page, or longtable for one that spans pages with a repeating header.
- Add a caption and label if you want to reference the table in your text.
- Copy the output into your document, or download the
.texand\inputit.
Packages you may need
- booktabs — for
\toprule,\midrule, and\bottomrule: add\usepackage{booktabs}. These are the rules typographers actually recommend; untick the option to fall back to plain\hline, which needs no package. - longtable — add
\usepackage{longtable}. Note that a longtable is not a float, so it isn't wrapped intableand its caption goes inside the environment.
Escaping, and when to turn it off
LaTeX reserves ten characters, and a stray & or _ from a CSV cell will stop compilation with a confusing error a hundred lines later. Escaping converts & % $ # _ { } and turns ~ and ^ into their text commands, which is right for ordinary data. Turn it off only when your cells deliberately contain LaTeX — inline maths like $\alpha$, or a \textbf{} you put there on purpose.
Alignment is inferred, not guessed at random
Each column is sampled and gets r if every non-empty value parses as a number, otherwise l. Right-aligned numbers line up on their digits, which is what makes a table readable. For decimal-point alignment across mixed precision, edit the spec to use the siunitx package's S column type.
FAQ
Can I get a Markdown table instead?
Yes — CSV to Markdown, or CSV to ASCII table which also has a Markdown style.
My table is too wide for the page.
Wrap it in \resizebox{\textwidth}{!}{…}, or reduce the columns first with Keep / rename / reorder.
Does it handle multi-line cells?
Cell content is emitted as-is on one line. For wrapping text, change the column spec to p{3cm} after generating.
Is anything uploaded?
No — it runs in your browser.
Privacy
100% client-side. No upload. See the privacy policy.