Guide
From spreadsheet to LaTeX table
Tables are where LaTeX is least forgiving. Every cell needs an ampersand, every row a double backslash, every percent sign an escape, and a single missing character stops the document compiling. Results, though, usually live in a spreadsheet. This generator converts cells from Excel, Google Sheets or a CSV file into tabular code you can paste into Overleaf or any LaTeX editor.
Getting the data in
Paste cells straight from a spreadsheet, or open a CSV, TSV or Excel file. Say whether the first row is a header. The code updates as you change the options.
Rules: booktabs or grid
Most journals and style guides prefer the booktabs look: three horizontal rules (top, below the header, bottom), no vertical lines, and better spacing around them. It needs \usepackage{booktabs} in the preamble, which the output reminds you of. The grid option draws vertical lines between columns and a horizontal line between every row, a look some course templates still ask for. “Header rule only” puts a single line under the header.
Alignment
Text reads best left-aligned and numbers right-aligned so their digits line up. In automatic mode, each column whose values are all numbers gets r and the rest get l; you can also force every column to l, c or r. The column specification appears in the \begin{tabular}{…} line, where you can still change any letter by hand.
Floats, captions and labels
Inside a table float, LaTeX places the table where it fits best ([htbp] means here, top, bottom or a separate page) and numbers its caption. Add a caption and a label such as tab:results, then refer to it in the text with \ref{tab:results}. For tables longer than a page, choose longtable: the header repeats on every page and the table breaks across pages, which a float cannot do.
Escaping special characters
Ten characters have special meanings in LaTeX. The converter escapes them all: & becomes &, % becomes %, $ becomes $, # becomes #, _ becomes _, braces get backslashes, and ~, ^ and \ become their text commands. Leave escaping on unless your cells already contain LaTeX, such as $\alpha$ or \textbf{…}, which escaping would print literally.
A worked example
The sample compares three models by parameters, accuracy and time. The model and parameter columns hold text (1.2M is not a plain number), so the column specification is llrr. The header “Accuracy (%)” is written as Accuracy (\%) and the float carries the label tab:results.
Finishing touches in the document
Check that the table fits the text width, keep units in the header rather than in every cell, and round values to the precision the data supports. Consider bolding the best result in each column by hand, a convention in many results tables.
Common compile errors and fixes
“Misplaced alignment tab character &” means an unescaped ampersand slipped in, usually because escaping was off. “Extra alignment tab” means a row has more cells than the column specification; add a letter to the specification or remove the cell. “Undefined control sequence \toprule” means booktabs is missing from the preamble. And if the table appears pages away from where you wrote it, that is the float at work: try [!htbp] or reduce its size.
Related tools
Convert text tables from a terminal with the ASCII Table Converter, make Markdown tables with CSV to Markdown Table, wiki tables with CSV to MediaWiki, or organise sources for the paper in the Literature Matrix Builder.
Checked against the current version of the CSV to LaTeX Table Generator on .

