Account

What new tool do you want?

Text & Writing

LaTeX Table Generator (from Excel or CSV)

Paste cells from Excel, Google Sheets, CSV or a Markdown table and get clean LaTeX tabular code: booktabs or grid lines, automatic number alignment, bold header, caption and label, with special characters escaped.

How to use

  1. 1Copy cells from a spreadsheet and paste them in (or type comma-separated values).
  2. 2Choose the line style, alignment, caption and label.
  3. 3Copy the LaTeX code into your document. For booktabs, add \usepackage{booktabs} to the preamble.

Frequently asked questions

What's booktabs and why is it the default?

booktabs is the LaTeX package most journals and style guides recommend. It uses three horizontal rules of different weights (top, middle, bottom) and no vertical lines, which reads more cleanly than a full grid.

How does automatic alignment work?

Columns where every value below the header is a number (including decimals, negatives and percentages) are right-aligned so digits line up; all other columns are left-aligned.

Why are some characters changed?

&, %, $, #, _, {, }, ~, ^ and \ have special meanings in LaTeX and break compilation if left as they are, so they're escaped (for example % becomes \%). Turn escaping off if your cells already contain LaTeX such as $\alpha$.

Worked example: a three-row results table

Pasting 'Group, Mean, SD' followed by 'Control, 12.4, 3.1' and 'Treatment, 15.9, 2.8' with the defaults gives a table environment with \caption{Results} and \label{tab:results}, a tabular with column spec lrr (Group left-aligned, the two number columns right-aligned), \toprule above the header, \midrule under it, and \bottomrule at the end. Each row ends in \\ and cells are separated by &.

Pasting from a spreadsheet

When you copy cells from Excel, Numbers, LibreOffice or Google Sheets, the clipboard holds them as tab-separated text, so cells that contain commas (like '1,250' or 'Smith, J.') stay in one piece. Comma- or semicolon-separated text and Markdown tables with | separators also work. Rows that are shorter than the longest row are padded with empty cells so the table always compiles.

Caption above, label after

Tables are captioned above the table in APA, IEEE and most journal styles, so the caption comes first. The \label must come after \caption: LaTeX attaches a label to the most recent numbered item, and a label placed before the caption makes \ref point at the section number instead of the table number.

Related tools

More: Text & Writing