CSV ↔ Markdown table
Convert CSV to a Markdown table (alignment row added, pipes escaped as \|) and back (alignment rows dropped, \| and <br> restored, quoting applied only when needed).
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Converted output
Pipes inside cells are escaped as \|, and <br> in Markdown becomes a line break.
Enter content to see the converted output
Every CSV row must have the same number of columns; the Markdown direction ignores non-table lines and drops | --- | alignment rows.
What this tool does
- Turn exported CSV into a table you can paste straight into Markdown or a README.
- Turn a Markdown table from a doc or issue back into CSV for a spreadsheet.
- Round-trip a table through both directions to check how pipes and <br> are handled.
Example
Input
name,age Alice,20
Output
| name | age | | --- | --- | | Alice | 20 |
The first row becomes the header with a | --- | row added; the reverse direction drops it again.
Frequently asked questions
What happens to the header in the CSV direction?
By default the first row is treated as a header: it is emitted as the header row followed by a | --- | row. If your data has no header, switch "First row is the header" off and no separator row is added.
How are pipes and line breaks inside cells handled?
CSV → Markdown escapes | as \| and line breaks as <br>; Markdown → CSV reverses that, restoring \| and <br> (cells containing a line break are quoted).
How does the Markdown direction detect a table?
It reads lines containing pipes — both | a | b | and a | b work (outer pipes optional) — drops alignment rows such as | --- |, :---: and ---:, and ignores lines that are not part of a table.
What if the column counts differ?
It raises an error instead of guessing: the CSV direction requires every row to have the same number of columns, and the Markdown direction requires all table rows to match (a missing cell counts as irregular).
Are multi-line fields supported?
No. Both directions parse line by line, so a quote or cell spanning lines is reported as an unclosed quote or an inconsistent column count rather than being silently mis-split.
Keywords:CSVMarkdowntableGFMmarkdown table to csv