CSV to Markdown Table Converter

Convert CSV data to Markdown tables and Markdown tables back to CSV.

CSV Input
Markdown Output

When a CSV ↔ Markdown table converter is the right tool

Use this page to turn a headered CSV table into a Markdown pipe table, or to flatten a Markdown table back to CSV. Choose a direction, paste the source, and click Convert. The result does not update as you type. Nothing is uploaded.

The CSV reader here understands quoted commas, unlike CSV ↔ JSON. It does not guess types or write YAML — for that use CSV ↔ YAML.

Use cases

Pasting a spreadsheet export into a README

Leave the direction on CSV → Markdown, paste a header row and the rows beneath it, and Convert. Load Sample uses a short Name, Age, and City table, including a city that would need quotes in CSV form.

Getting CSV back out of a Markdown table

Switch to Markdown → CSV and paste a pipe table. Alignment colons in the separator are fine. Text above or below the table is ignored. The output is a header line plus data rows, with quoting only when a cell contains a comma or a quote.

How conversion works

CSV → Markdown trims the text, drops empty lines, parses rows with a quoted-comma splitter, pads short rows, and writes a header, a --- separator, and body rows. Markdown → CSV keeps only pipe-leading lines, skips the separator, and joins cells with commas. Switching direction clears both editors. Errors are swallowed and leave the output empty.

Example — a small CSV table, including a quoted comma, as Markdown
Name,Age,City
Alice,30,New York
Bob,25,"London, UK"

| Name | Age | City |
| --- | --- | --- |
| Alice | 30 | New York |
| Bob | 25 | London, UK |

The comma in London, UK stays in one cell because it was quoted in the CSV. Going back to CSV will quote that city again.

What this tool does not do

It does not escape pipes in cells, parse tab- or semicolon-separated files, or keep a quoted field that spans lines. It does not update live, and it does not upload anything.

How to use CSV to Markdown Table Converter

  1. Choose CSV → Markdown or Markdown → CSV. Switching tabs clears the input.
  2. Paste the source, or use Load Sample for a short example in the current direction.
  3. Click Convert, then Copy when the output looks right.

Frequently asked questions

How does CSV → Markdown work?

The first non-empty line becomes the header row. Later lines become table body rows. Empty lines are dropped. Each line is split on commas, except inside double quotes; a doubled quote becomes a literal quote. Cells are trimmed. Shorter rows are padded so every row has as many columns as the widest line. The separator row is written as --- in every column, with no alignment colons. You have to click Convert; editing the input clears the output.

How does Markdown → CSV work?

Only lines whose trimmed text starts with | are read; surrounding prose is ignored. A separator row made of pipes, spaces, hyphens, and colons (including :--- and ---: alignment) is skipped. Leading and trailing pipes are stripped, cells are split on | and trimmed, and a cell that contains a comma or a quote is quoted for CSV. You still have to click Convert.

Does the CSV reader understand quoted commas and other delimiters?

Quoted commas and doubled quotes are honored on a single line. A quoted field that contains a newline will split, because the reader is line-based. Tabs and semicolons are not treated as delimiters. Pipe characters inside a cell are not escaped, so they can break the Markdown table.

Do the results update as I type? Is there a Swap button?

No. You have to click Convert. Switching CSV → Markdown or Markdown → CSV clears both editors. Load Sample pastes a short Name/Age/City example for the current direction and clears the output. There is no Swap control.

Is my data sent to a server?

No. Conversion runs in your browser. Closing the tab discards what you pasted.

Related tools and guides

References

  • RFC 4180 describes quoted CSV fields. This converter honors quoted commas on a single line, but it does not reassemble a quoted field that spans lines.
  • CommonMark tables are an extension, not core Markdown. This page writes a simple pipe table with an unaligned --- separator row.