styleLatex
All free tools

LaTeX Table Generator

Type your data into the grid, merge cells across rows or columns, and pick a style. This LaTeX table generator writes the tabular code as you go, with the packages it needs, ready for Overleaf or any LaTeX editor.

Click a cell, then Shift-click another to select a block. On a touch screen, tap Select block first.

Truth table

LaTeX

\begin{table}[htbp]
\centering
\begin{tabular}{lrr}
\toprule
\textbf{Method} & \textbf{Accuracy (\%)} & \textbf{Time (s)} \\
\midrule
Baseline & 82.1 & 1.20 \\
Ours & 91.4 & 0.95 \\
\bottomrule
\end{tabular}
\end{table}

Add to your preamble: \usepackage{booktabs}

Table only in an image or PDF? Convert it instead of retyping.

Convert a table

How to use the LaTeX table generator

Fill in the grid

Start the LaTeX table generator by setting rows and columns, then type into the cells. Buttons add a row below or a column to the right. Each column has its own alignment: left, center, right, or wrap, which gives a fixed-width paragraph column for long text.

Merge cells across rows and columns

Click one cell, Shift-click another, and press Merge. Across columns this writes \multicolumn, across rows \multirow, and across both it nests the two. Rules under a merged cell are cut around it; Unmerge splits it again.

Choose the style and copy the code

Booktabs gives the three-rule look most journals use; All borders draws every line, like a spreadsheet. Add a caption and label, copy the code, and add the \usepackage lines listed under it.

Tables that do not fit the page

Wider than the text

Scale to text width wraps the tabular in \resizebox, which shrinks the text too. Full width, wrap text switches to tabularx so the table fills \textwidth and long cells wrap onto new lines instead. For a few extra columns, a smaller font size often reads better than scaling.

Longer than a page

Tick long table and the LaTeX table generator writes a longtable, which breaks across pages on its own. The header row goes before \endhead, so it repeats on every page. A longtable is not a float, so placement and width are not used, and it only works in one-column documents.

Rotated and two-column tables

Rotate puts the table in a sidewaystable from the rotating package, turning it to landscape on its own page. In a two-column paper such as an IEEE conference template, span two columns uses table* so it runs across both columns.

Other ways to start a table

Edit a table you already have

Paste existing tabular, tabularx or longtable code into the import box and load it. The LaTeX table generator reads the cells, column alignment, line style and merged cells back into the grid, so you can add a row or fix a merge without counting ampersands.

Truth tables

Pick up to five inputs and an AND, OR or XOR output, and the grid fills with every 0 and 1 combination and its result, or leave the output empty to fill in. Headers use math mode, such as $A \land B$.

From a spreadsheet or an image

Cells copied from Excel or Google Sheets paste into the import box too. For a whole CSV or XLSX file, use the Excel to LaTeX converter; for a screenshot or scan, convert the image instead of retyping it.

Excel to LaTeX

Official references: booktabs (CTAN) · The LaTeX Project

LaTeX Table Generator: styleLatex card with the tool's purpose and a code sample | LaTeX Table Generator

LaTeX table questions

How to make a table in LaTeX?
Put a tabular environment inside a table float: \begin{tabular}{lcr}, with & between cells and \\ at the end of each row. The table float adds \caption and \label. This LaTeX table generator writes that code from the grid.
How to make table fit page in LaTeX?
Use \resizebox{\textwidth}{!}{…} around the tabular to scale it, or tabularx with X columns so text wraps. A smaller font such as \small also helps. The width setting above writes either version.
How to reference tables in LaTeX?
Give the table a \label after its \caption, such as \label{tab:results}, then write Table~\ref{tab:results} in the text. Compile twice so the number appears.
How to merge two rows in LaTeX table?
Load the multirow package and write \multirow{2}{*}{Text} in the first row, leaving that cell empty in the second row. In the LaTeX table generator, select both cells and press Merge.
How to center a table in LaTeX?
Put \centering right after \begin{table}. To center the text inside the cells, use c in the column spec, as in {ccc}. The LaTeX table generator adds it for you.
How to force a table to stay in place LaTeX?
Load the float package and use [H] as the placement, which puts the table exactly where it is in the source. [h] only asks LaTeX to try. The LaTeX table generator calls this Exactly here.
How to make a truth table in LaTeX?
A truth table is an ordinary tabular with centered columns of 0 and 1 and a math header such as $A \lor B$. Use the truth table option above to fill every row for up to five inputs.
How to rotate a table in LaTeX?
Load the rotating package and replace table with sidewaystable, which turns the table and puts it on its own page. Tick Rotate in the LaTeX table generator.
How to wrap text in LaTeX table?
Use a paragraph column such as p{3cm} instead of l, c or r, or tabularx with X columns that share the text width. Set a column to Wrap, or choose full width.
How to add a caption to a table in LaTeX?
Write \caption{Your text} inside the table float. Tables usually take the caption above the tabular, where the LaTeX table generator puts it.
How to make a table span two columns in LaTeX?
In a two-column document, use table* instead of table. It can only float to the top or bottom of a page. The LaTeX table generator does this with Span two columns.
How to put two tables side by side in LaTeX?
Put two subtables or two minipages of width 0.48\textwidth in one table float, each with its own tabular and caption. Generate both in the LaTeX table generator, then paste them in.
How to change font size in table LaTeX?
Put a size command such as \small or \footnotesize after \centering, inside the table float, so it only affects the table. The font size setting adds it.
How to merge cells in LaTeX table?
Use \multicolumn{n}{c}{Text} to join n cells in a row, and \multirow for cells in a column. The LaTeX table generator writes both from a selected block.
How to fit a long table in LaTeX?
Use the longtable package so the table breaks across pages, with the header before \endhead to repeat it. Tick Long table over pages.
How to increase row height in LaTeX table?
Add \renewcommand{\arraystretch}{1.3} before the tabular to stretch every row, or add space after one row with \\[4pt]. With booktabs, \addlinespace also works.
How to add vertical lines in a LaTeX table?
Put | between the column letters, as in {|l|c|r|}, and use \hline for horizontal lines. Choose All borders in the LaTeX table generator. Booktabs tables leave out vertical lines on purpose.
How to add a footnote to a table in LaTeX?
Use the threeparttable package: put the tabular in threeparttable and write the notes in a tablenotes environment under it. A plain \footnote inside a float does not print.
Does the LaTeX table generator support booktabs?
Yes, it is the default line style: \toprule, \midrule under the header and \bottomrule, with \cmidrule under merged cells. You need \usepackage{booktabs}.
Can I load an existing LaTeX table into the generator?
Yes. Paste tabular, tabularx or longtable code into the import box. Cells, alignment, lines and merged cells are read back; custom commands stay in the cells as text.
Can the LaTeX table generator make a table from an image?
Not directly. Upload a screenshot or photo of the table to our converter, which returns the LaTeX code.
Which packages does the generated LaTeX table need?
It depends on the options: booktabs for the three rules, multirow for merged rows, tabularx, longtable, graphicx for scaling, rotating for landscape and float for [H]. The exact list is shown under the code.

Have a whole page of notes, a scan or a PDF? Convert it to LaTeX that compiles.

Convert a file