Convert Excel to LaTeX Table Online
Turn a range of an Excel sheet into a LaTeX tabular for a paper, thesis or report. The workbook is opened in your browser and never uploaded.
Drop a CSV or Excel file here
CSV · XLSX · XLS · XLSM · XLSB
Ready to download as a binary file.
How to convert Excel to a LaTeX table
Three steps from grades.xlsx to LaTeX.
1. Drop the workbook
Drop an .xlsx, .xls, .xlsm or .xlsb file, or paste cells copied from Excel.
2. Check it in the grid
Round numbers in Excel or in the grid first. The table gets the values as they appear, and long decimals make wide columns.
3. Choose environment and rules
tabular or longtable, booktabs rules or grid lines, alignment and escaping; copy the code or download data.tex.
Example: Excel in, LaTeX out
Test scores with a Mean column calculated by =AVERAGE(B2:C2).
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | Test 1 | Test 2 | Mean |
| 2 | A. Novak | 78 | 85 | =AVERAGE(B2:C2) |
| 3 | B. Okafor | 91 | 88 | =AVERAGE(B3:C3) |
\begin{tabular}{|l|l|l|l|}
\hline
Student & Test 1 & Test 2 & Mean \\
\hline
A. Novak & 78 & 85 & 81.5 \\
B. Okafor & 91 & 88 & 89.5 \\
\hline
\end{tabular}Mean comes through as the calculated 81.5 and 89.5. Tick booktabs for the cleaner horizontal-rule style journals usually ask for.
What changes between Excel and LaTeX
Escaping
& % $ # _ { } ~ ^ are escaped, so plain text can't break the table. The sample has none of them. Untick Escape special chars only when the cells already contain LaTeX, such as math in $...$.
booktabs
Tick booktabs for \toprule, \midrule and \bottomrule and no vertical lines, the style most journals ask for. A comment above the table reminds you to load \usepackage{booktabs}.
One sheet at a time
Only the sheet whose tab is active goes into the LaTeX: here "Results". Click the "Raw" tab to convert that sheet instead.
When to convert Excel to LaTeX
- Moving results calculated in Excel into a LaTeX paper without retyping them.
- Keeping one spreadsheet as the source and regenerating the table whenever the numbers change.
Excel to LaTeX in JavaScript
TabularJS reads every sheet; the snippet picks one by name. Then special characters are escaped and cells joined with &.
import tabularjs from 'tabularjs';
const { worksheets } = await tabularjs('grades.xlsx');
const sheet = worksheets.find((ws) => ws.worksheetName === 'Results');
const [header, ...rows] = sheet.data; // Mean arrives as "=AVERAGE(B2:C2)"
const map = { '\\': '\\textbackslash{}', '~': '\\textasciitilde{}', '^': '\\textasciicircum{}' };
const esc = (v) => String(v ?? '').replace(/[\\&%$#_{}~^]/g, (c) => map[c] ?? '\\' + c);
const line = (cells) => cells.map(esc).join(' & ') + ' \\\\';
console.log([`\\begin{tabular}{|${header.map(() => 'l').join('|')}|}`, '\\hline', line(header), '\\hline',
...rows.map((row) => line(header.map((_, i) => row[i]))), '\\hline', '\\end{tabular}'].join('\n'));Unlike this page, TabularJS does not calculate formulas: Mean comes back as "=AVERAGE(B2:C2)". Dates arrive as serial numbers (45414 is 2024-05-02).
Frequently asked questions
Can I keep the cell borders from Excel?
Borders aren't read. You get either full grid lines (|l|l| with \hline, the default) or booktabs rules; edit the column spec by hand for anything in between.
How do I show two decimals, like 81.50?
LaTeX prints the values as text, so 81.5 stays 81.5. For fixed decimals, load siunitx and use an S column, or write \num[round-mode=places,round-precision=2]{81.5}.
Does it work with .xlsm files that contain macros?
Yes. The data is read and the macros are ignored; they are never run.
How do I add a caption?
Wrap the tabular in a float: \begin{table}[h] \centering ... \caption{Your caption} \end{table}. With longtable, put \caption{...} \\ as the first line inside the longtable instead.
Does grades.xlsx get uploaded when I convert it to LaTeX?
No. The workbook is opened in your browser and never uploaded.