gizmobench
BrowseDaily

LaTeX Table Generator

Build a LaTeX table from an editable grid or pasted CSV and spreadsheet values. Choose column alignment, booktabs, hline or no rules, then copy the tabular block into your document. Text-mode characters such as ampersands and percent signs are escaped automatically. Raw math is optional and requires dollar-sign spans in the cells. The preview displays your cell values as an HTML table; it does not compile LaTeX.

Grid3 x 3
The editable grid. Each cell is a text box and Tab moves to the next one.
C1 l
C2 r
C3 l
H
1
2
LaTeXbooktabs
\begin{tabular}{lrl}
\toprule
Sample & Yield \% & Note \\
\midrule
A\_1 & 91.4 & 50\% run \\
B\_2 & 88.0 & re-run \& held \\
\bottomrule
\end{tabular}
Rows
3
Columns
3
Alignment
l r l
Rules
booktabs

3 columns by 3 rows, 8 lines of LaTeX, 5 characters escaped.

Needs \usepackage{booktabs} in the preamble. The buttons beside a row and above a column move it with every value in it, and the alignment moves with the column. Past 1,000 cells the grid is edited as text instead, because a page of that many boxes is not an editor.

C1C2C3

Preview

The same grid, drawn as a table. Cell text is drawn as text, so a marked math span shows here as the characters you typed rather than as a typeset formula.

SampleYield %Note
A_191.450% run
B_288.0re-run & held
  • & % _ # in a celltext mode
    escaped as R\&D 50\% a\_b \#3, 2 columns unchanged
  • A formula in a cellmath marked by hand
    $\sigma^2$ is copied through raw
  • A short TSV row3 columns declared
    padded to 3 cells and flagged, never shifted
How the source is written. LaTeX reserves 10 characters, and every one of them is escaped in a cell: \ & % $ # _ { } ~ ^ become \textbackslash{} \& \% \$ \# \_ \{ \} \textasciitilde{} \textasciicircum{}. Each cell is escaped in a single pass, so the empty braces those three commands carry are never escaped a second time. A line break typed inside a cell becomes a space, because an l, c or r column is a single line. The grid holds 200 rows by 50 columns, and it stays in this browser alone, as a saved record of up to 200,000 characters that the Start over button above the heading forgets.
Accuracy. Every cell is escaped for LaTeX text mode unless you mark it as math yourself, so an ampersand becomes a character rather than a column break and a percent sign does not comment out the rest of the line. The HTML preview is built from the same grid as the source, so what you read is what you copy.

Common questions

How do I escape special characters in a LaTeX table?
Type them into the cell and this page escapes them for you. LaTeX reserves ten characters in text mode, and every one of them is written out: a backslash becomes \textbackslash{}, an ampersand becomes \&, a percent sign becomes \%, a dollar sign becomes \$, a hash becomes \#, an underscore becomes \_, a left brace becomes \{, a right brace becomes \}, a tilde becomes \textasciitilde{} and a caret becomes \textasciicircum{}. Two of those are the ones that bite: an unescaped ampersand opens a column the tabular was never declared with, and an unescaped percent sign comments out everything after it on that line, including the row terminator. A cell reading re-run & held comes out as re-run \& held, and its row still has the same number of column breaks as every other row. The cell is escaped in a single pass, so the empty braces that \textbackslash{}, \textasciitilde{} and \textasciicircum{} carry are left alone rather than escaped again, which is the mistake that prints a stray brace in the finished table. A less-than or greater-than sign is not one of the ten and is passed through as you typed it; under the default font encoding LaTeX prints those two as inverted punctuation, so load fontenc with the T1 option if your table uses them.
Can I paste a table from Excel or Google Sheets?
Yes, in the Text view. Cells copied out of a spreadsheet arrive as tab separated rows and the grid follows as you paste: Auto works out whether it is looking at tabs or commas, and the Tab and Comma buttons override the guess when it is wrong. A value wrapped in double quotes keeps its commas, its line breaks and any quote written twice inside it, which is how a spreadsheet exports a cell containing one. Nothing changes silently: a row that arrives with fewer values than the widest row is filled out on the right with empty cells and the page says how many rows it padded, and blank lines are skipped and counted. Copy TSV hands the grid back in the same form, so it goes back into a spreadsheet the way it came out.
Should I use booktabs or hline rules?
Booktabs is the default here and writes \toprule, a \midrule under the header row and \bottomrule at the end, with no vertical bars, which is what the package's own guidance asks for in a formal table. It is the one choice that needs something in your preamble, so the page names \usepackage{booktabs} beside the result and stops naming it as soon as you switch away. Lines writes the classic \hline above, below and between every row, and puts bars in the column spec, so a two column table opens with \begin{tabular}{|l|r|}. None writes the rows and the tabular environment and nothing else. Whichever you choose, the Rules cell in the readout says which one is in the source you are about to copy.
How do I put a formula or a dollar amount in a cell?
A dollar sign is text until you say otherwise. With the default Text setting, a cell holding a price is escaped and reaches your document as the amount you typed. Switch the dollar sign control to Raw math and a span you mark with dollar signs inside a cell is copied through exactly as typed, while the text around it is still escaped: a cell reading the words before a marked span, the span, and a percent sign after it comes out with the span raw and the percent sign escaped. Marking is the opt in, so a cell that holds no dollar signs is escaped as text even in that mode. A cell with an odd number of dollar signs is refused by row and column, because one span never closes and guessing where you meant it to end would be a worse answer than saying so.
How do I add a caption and a label to the table?
Wrap what you copy in a table environment: \begin{table}[ht] and \centering, then \caption{} and \label{} with your own text in the braces, then the tabular block this page writes, then \end{table}. Most styles put a table's caption above the table, which is why the caption line goes before the tabular block rather than after it. This page writes the tabular block and nothing around it on purpose: the float, where it is allowed to land and what it is called belong to your document, and a generator that guesses them hands you lines to delete every time.
How large can the table be, and does anything leave my browser?
The grid holds 200 rows by 50 columns, the header row counted among the rows. Past that nothing is cut down quietly: a paste of 201 rows is refused with its own numbers and the limit beside them, so you can split it or paste the rows you need. Up to a thousand cells the grid is one text box per cell; past that the editor is the text view instead, because a page holding that many boxes is not one you can type in. Nothing is sent anywhere and there is no account: the source is built in your own browser, the draft is kept in this browser alone so it is still there when you come back, and the Start over button above the tool forgets it. Storage blocked or a private window changes nothing except that it does not remember.
What happens to a line break inside a cell?
It becomes a single space, and the page counts it. An l, c or r column is one line by definition: a line break inside such a cell is whitespace at best, and two of them in a row would, if they reached the source, end the paragraph in LaTeX and stop its run with an error about a paragraph ending before the row was complete. Folding the break to a space keeps the row intact, and the status line says how many breaks were folded so nothing happens out of sight. If you need text on two lines inside one cell, the shortest route is to split it into two rows, or to change that column to a paragraph column by hand after copying the source.
Does the preview show what the finished table will look like?
It shows the same grid, drawn as an HTML table with the alignment you chose, so you can read the values in place while you edit them. It is not a rendering of LaTeX: a marked math span shows as the characters you typed, and the rules you chose are described in the readout rather than drawn. What the preview guarantees is that the source and the table on screen come from one grid, so a cell you can see is a cell the source carries, escaped.
How do I convert CSV or Excel cells to a LaTeX table?
Choose Text and paste CSV contents, or copy a range from Excel or Google Sheets and paste its tab-separated values. Choose Comma or Tab if Auto picked the wrong format. Set alignment, rules and whether the first row is a header, then Copy. This page reads pasted values, not XLSX files: it does not preserve workbook formatting, merged cells, charts or formulas as executable spreadsheet formulas.
Can I use the result in Overleaf?
Paste the tabular block into your document where the table belongs. With Booktabs selected, add \usepackage{booktabs} in the preamble. For a numbered caption, wrap the block in a table environment with your caption and label. This page does not connect to Overleaf or compile the result; Unicode text, fonts, page width and package compatibility depend on your document setup.
Can I generate a truth table directly from a logical expression?
This grid does not evaluate logical expressions. Use <a href="/truth-table-generator">Truth Table Generator</a> to calculate the values, export its CSV, and paste the CSV here if it fits the 200-row and 50-column limits. Then choose the table’s rules and copy the LaTeX source. A large truth table may need splitting or a different document layout.
Can I import a Word table, an image or existing LaTeX?
There is no DOCX, image or LaTeX-source parser. Paste cell values as CSV or TSV. Copy TSV exports the current grid, but it does not turn arbitrary LaTeX into Excel cells. Output uses ordinary l, c and r columns; merged cells, paragraph columns, longtable, chart conversion and PDF compilation are not generated.

Every cell is escaped for LaTeX text mode unless you mark it as math yourself, so an ampersand becomes a character rather than a column break and a percent sign does not comment out the rest of the line. The HTML preview is built from the same grid as the source, so what you read is what you copy.