Skip to content

Free tool

LaTeX Table Generator

Type your data or paste it from a spreadsheet, then copy LaTeX tabular code that compiles. The output uses booktabs rules, escapes special characters such as & and %, and can include a caption and label. No account needed.

1. Enter or paste your data

Type in the grid, or copy cells in Excel, Google Sheets or LibreOffice and paste them into any cell. The file stays in your browser.

3 × 3
Paste CSV or tab-separated text
2. Choose the style

3. Copy the LaTeX code

\begin{table}[htbp]
  \centering
  \caption{Results on the test set}
  \label{tab:results}
  \begin{tabular}{lrr}
    \toprule
    Method   & Accuracy (\%) & Time (s) \\
    \midrule
    Baseline & 89.7          & 3.4 \\
    Ours     & 94.1          & 1.2 \\
    \bottomrule
  \end{tabular}
\end{table}

Needs \usepackage{booktabs} in the preamble.

Preview

Table 1: Results on the test set

MethodAccuracy (%)Time (s)
Baseline89.73.4
Ours94.11.2

An approximation in the browser. LaTeX sets the final spacing and fonts when you compile.

Compile it

Check the table in a real PDF

LaTeX Cloud Studio opens a starter article in the browser with TeX Live, so you can paste the table into main.tex and see the compiled result without installing anything.

How the generated code works

A LaTeX table is a tabular environment. Its argument has one letter per column: l, c or r for left, centred or right alignment, and | for a vertical rule. Inside it, & separates cells and \\ ends a row.

The booktabs style draws \toprule, \midrule and \bottomrule and leaves out vertical lines, which is what most journals expect. It needs \usepackage{booktabs} in the preamble. The other two styles use only \hline.

With the table environment switched on, the tabular sits in a floating table with \centering, a \caption above it and a \label. Refer to it in the text with Table~\ref{tab:results}.

When the table does not compile

  • Undefined control sequence at \toprule: the preamble is missing \usepackage{booktabs}.
  • Misplaced alignment tab character &: a literal ampersand in text must be written \&. Keep escaping on unless you typed LaTeX in the cells. See common LaTeX errors.
  • Extra alignment tab has been changed to \cr: a row has more cells than the column specification. The generator pads every row to the same width, so this appears only after manual edits.
  • The table is wider than the page: shorten the headers, set the table in \small, or let a column wrap with p{4cm} or tabularx.

Merged cells, long tables and more

The generator covers the common case: a rectangular table with a header. For merged cells (\multicolumn, \multirow), tables over several pages, coloured rows and decimal alignment, the LaTeX Cloud Studio guides show compiled examples:

Questions

How do I make a table in LaTeX?

Put the cells in a tabular environment. The argument such as {lcr} sets one column per letter (left, centre, right), & separates cells and \\ ends a row. Wrap the tabular in a table environment to add \caption and \label.

Why does my table need \usepackage{booktabs}?

The commands \toprule, \midrule and \bottomrule come from the booktabs package. Without it LaTeX stops with "Undefined control sequence". Add \usepackage{booktabs} to the preamble, or choose the "All lines" or "Minimal" style, which use only \hline.

Can I paste a table from Excel or Google Sheets?

Yes. Copy the cells in the spreadsheet and paste them into any cell of the grid. The data fills the grid from that cell. CSV files with commas or semicolons also work, through the CSV file button or the paste box. Nothing is uploaded; the conversion runs in your browser.

How do I merge cells in a LaTeX table?

Use \multicolumn{2}{c}{Text} to span columns and \multirow from the multirow package to span rows. The generator does not merge cells yet; generate the table, then replace the cells you want to merge.

What does "Misplaced alignment tab character &" mean?

An & appears outside a tabular or align environment, usually in normal text such as "R&D". Write it as \&. The generator escapes &, %, $, #, _, {, }, ~, ^ and \ for you unless you turn escaping off.