Skip to content
FastTool

How to convert Excel or CSV data into clean Markdown and LaTeX booktabs tables

Spreadsheet cells copied into plain text lose column alignment and contain raw pipe, percent, or underscore characters that break Markdown and LaTeX.

Updated · Uses the free CSV, JSON, Markdown & LaTeX Table Converter, which runs in your browser

Short answer

Paste spreadsheet cells or open a CSV file in CSV, JSON, Markdown & LaTeX Table Converter. Keep Auto-right-align numeric columns ticked so numbers and percentages use ---: in Markdown and right-aligned columns in LaTeX. Pick Markdown (Padded) for readable GitHub tables with escaped \| pipes, or pick LaTeX booktabs for escaped \% and \_ output. Click Copy output or download a ready-to-use .md or .tex file.

Open the CSV, JSON, Markdown & LaTeX Table Converter

Choosing padded Markdown, compact Markdown, or LaTeX booktabs

Each export style formats the same parsed spreadsheet grid for a different publishing target:

When to pick padded Markdown, compact Markdown, LaTeX booktabs, or LaTeX \hline
Output mode Best target How columns and borders are written
Markdown (Padded) README files, pull requests, and plain-text notes. Pads every cell with spaces so pipes line up vertically in monospace editors.
Markdown (Compact) Issue trackers and chat widgets with character limits. Omits extra padding while keeping :---, :---:, and ---: alignment markers.
LaTeX booktabs Academic papers, technical reports, and theses. Writes \toprule, \midrule, and \bottomrule with zero vertical bars.
LaTeX \hline Strict templates where extra LaTeX packages are disallowed. Uses standard |l|r| column specs and \hline rules with zero preamble imports.

Four characters that break Markdown and LaTeX tables

Spreadsheet exports often contain punctuation that acts as control syntax inside documentation compilers:

  • Vertical pipe and line breaks in Markdown. Unescaped pipes create extra columns, and raw line breaks need <br> tags to stay inside one cell.
  • Percent sign in LaTeX: comments out everything to the right on that line, hiding the row-ending \\ and halting pdflatex.
  • Dollar and underscore in LaTeX: currency symbols open unintended math blocks, and underscores inside column names like Run_ID trigger missing-math errors.
  • Ampersand and backslash in LaTeX: raw ampersands act as extra column separators unless written as \&, and backslashes need \textbackslash{}.

Worked example: four spreadsheet rows into Markdown and LaTeX booktabs

Open CSV, JSON, Markdown & LaTeX Table Converter to inspect a made-up 4-row optical reagent summary pasted from a sheet:

  1. Tab detection. Copying cells from Excel or Google Sheets places tabs between columns, which Auto-detect reads as Spreadsheet TSV.
  2. Numeric right-alignment. Unit cost ($18.50), yield (94.2%), and peak wavelength (512) align right while leading-zero code 0104 stays left-aligned.
  3. Safe LaTeX escaping. Switching to LaTeX booktabs rewrites Buffer_A & NaCl, $18.50, and 94.2% into Buffer\_A \& NaCl, \$18.50, and 94.2\%.
  4. Preamble reminder. Add \usepackage{booktabs} once to your LaTeX preamble before compiling the pasted tabular block.

You can open the spreadsheet TSV to LaTeX booktabs example or open the GitHub Markdown pipe-escaping example directly in your browser.

Preparing PDF tables, messy CSVs, or nested JSON first

Clean irregular source files with the matching table utility before generating publication markup:

Common mistakes

  • Adding vertical bars to booktabs tables. Vertical pipe rules leave visible gaps around \toprule and \midrule; switch to LaTeX \hline if boxed borders are mandatory.
  • Left-aligning decimal numbers and percentages. Keep numeric columns right-aligned so ones, tens, and decimal points line up down each column.
  • Exporting wide 15-column sheets to portrait PDFs. Tick Transpose rows ↔ columns when you have many metrics across only three or four items.

Sources

Spotted a mistake in this guide? Email contact@fasttool.app. We reply within 7 business days.

Open the CSV, JSON, Markdown & LaTeX Table Converter