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.
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:
| 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_IDtrigger 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:
- Tab detection. Copying cells from Excel or Google Sheets places tabs between columns, which Auto-detect reads as Spreadsheet TSV.
- Numeric right-alignment. Unit cost ($18.50), yield (94.2%), and peak wavelength (512) align right while leading-zero code
0104stays left-aligned. - Safe LaTeX escaping. Switching to LaTeX booktabs rewrites Buffer_A & NaCl, $18.50, and 94.2% into
Buffer\_A \& NaCl,\$18.50, and94.2\%. - 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:
- Tables trapped inside a PDF: extract rows into CSV first with PDF Table Extractor, keeping leading-zero IDs intact.
- Duplicate rows or unwanted CSV columns: filter and trim your sheet in CSV Cleaner & CSV to Excel before pasting the clean CSV.
- Broken JSON syntax or JSON Lines: check brackets and flatten records in JSON Formatter & Validator first.
Common mistakes
- Adding vertical bars to booktabs tables. Vertical pipe rules leave visible gaps around
\topruleand\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
- IETF RFC 4180 CSV specification (checked 30 November 2026), defining quoted fields, multiline cells, and doubled quote escapes.
- GitHub Flavored Markdown Spec (checked 30 November 2026), defining pipe table syntax,
\|cell escaping, and colon alignment rules. - CTAN booktabs package documentation (checked 30 November 2026), detailing top, middle, and bottom horizontal rule spacing without vertical rules.
- MDN HTML table element reference (checked 30 November 2026), covering semantic thead,
<th scope="col">, and tbody structure.
Spotted a mistake in this guide? Email contact@fasttool.app. We reply within 7 business days.