CSV to Markdown Table

Convert CSV or TSV to a padded GitHub-flavored Markdown table. Detects the delimiter, escapes pipes and aligns columns. Runs in your browser, nothing uploaded.

Loading tool…

Worked examples

  • A spreadsheet export with numbers

    With alignment on auto, the all-numeric columns are right-aligned and the text column is left alone, which is how you would format it by hand.

  • Semicolon-separated, pipe inside a cell

    European spreadsheets export with semicolons, and a literal pipe would break a Markdown table, so the tool detects the delimiter and escapes the pipe.

  • No header row, centered columns

    Markdown tables must have a header line, so when the CSV has none the tool writes an empty one and keeps every CSV row as data.

What this does

Paste CSV or TSV and get a GitHub-flavored Markdown pipe table back: a header row, a separator row that carries the column alignment, and one line per record. Cells are padded so the raw text lines up in a monospaced editor, which makes the table readable in a pull request diff as well as when rendered.

How it works

The input is parsed with a real CSV parser, so a quoted field such as "Turing, Ada" stays in one cell, and a quoted cell can contain line breaks or doubled quotes as RFC 4180 describes. Then the tool applies these rules:

  1. Delimiter. On auto, it counts commas, semicolons and tabs outside double quotes on the first record and picks the most frequent, preferring comma on a tie. You can force comma, semicolon or tab instead. The result panel tells you which one it used.
  2. Header. With the header option on, the first record becomes the Markdown header row. With it off, the tool writes an empty header line, because a GFM table is not valid without one, and every CSV row stays a data row.
  3. Alignment. The separator row uses :---, :---: or ---: for left, center or right. On auto, a column is right-aligned when every non-empty body cell looks like a number (digits with optional sign, thousands commas, decimal point, percent or a currency symbol) and left alone otherwise.
  4. Escaping. A literal | becomes \|, and line breaks inside a cell become <br>, since a table row cannot span lines. Leading and trailing spaces in each cell are trimmed.
  5. Ragged rows. Rows shorter than the widest row are padded with empty cells so the table stays rectangular.

Edge cases and limits

  • Other Markdown characters are not escaped. An asterisk or a backtick in a cell is left as typed, which lets you keep **bold** or code formatting that came from your spreadsheet. If a cell should be shown literally, escape it yourself.
  • Raw HTML in a cell is left as typed. Most Markdown renderers pass <img ...> or <script> through, so if the CSV comes from an untrusted source, review the cells or use a renderer that sanitizes HTML before you publish the table.
  • Padding counts characters, not display width. Emoji and CJK characters take two columns in many editors, so the raw text may look slightly off. Rendering is unaffected, because renderers ignore the padding.
  • Pipe tables are a GFM extension. CommonMark, the base specification, has no table syntax. GitHub, GitLab, VS Code, Obsidian, MkDocs and most static-site generators support it, but a strict CommonMark renderer will print the text unchanged.
  • Formulas and numbers are text. The tool never reformats values, so 007 stays 007.
  • Input is capped at 2 MB and processed entirely in your browser.

An unterminated quote is reported with the row number rather than guessed at, since silently swallowing the rest of the file into one cell is the usual failure of naive converters.

When to use it

  • Putting a spreadsheet range into a README, wiki page or issue comment without retyping pipes.
  • Turning a database query result exported as CSV or TSV into something that renders in a pull request.
  • Pasting tab-separated cells copied straight out of Excel or Google Sheets: choose the tab delimiter (or leave auto), and the cells arrive already separated.

To work with the same data programmatically instead, the CSV to JSON converter reads the same input, and the CSV Diff tool compares two exports before you publish either one.

Frequently asked questions

Which Markdown flavor does the table use?
GitHub-flavored Markdown (GFM) pipe tables, which GitHub, GitLab, VS Code, Obsidian, Notion and most static-site generators render. Original Markdown and strict CommonMark have no table syntax, so they will show the text as-is.
What happens to a pipe character inside a cell?
It is written as \| so it stays part of the cell. Line breaks inside a quoted CSV cell become <br>, because a Markdown table row has to stay on one line.
How does the auto delimiter work?
The tool counts commas, semicolons and tabs outside double quotes on the first record and uses the most frequent one, preferring comma on a tie. If the guess is wrong for your file, choose the delimiter yourself.
My CSV has no header row. Can I still use this?
Yes. Turn off the header option and the tool writes an empty header line, since GFM requires one, then lists every CSV row as data.