Markdown Table to CSV
Markdown Table to CSV reads non-separator lines beginning with a pipe, removes outer pipes, splits on pipe characters, unescapes \|, and quotes output cells containing commas or double quotes. It is a lightweight table converter, not a Markdown parser: inline code containing pipes, multiline cells, HTML tables, alignment edge cases, and complex escaping can be misread.
Runs locally — files stay on your deviceDoes this produce fully general RFC 4180 CSV?
It quotes commas and double quotes in extracted cells, but source-table parsing is intentionally limited and cannot preserve multiline Markdown cells.
Pipe-table syntax is a Markdown extension with dialect differences
A common table uses header cells, a dash separator, and rows separated by pipes. CommonMark core does not define tables, and renderers can differ.
How it works
Only lines whose first non-space character is | are considered. Alignment/separator-looking lines are removed, row text is split on pipes, and CSV cells are quoted when necessary.
Key concepts
Only leading-pipe rows are read
Valid tables without an initial pipe are ignored.
CSV output quoting is cell-based
Commas and quotes trigger doubled-quote CSV encoding.
When to use it
- Convert a straightforward pipe table.
- Create CSV for a small controlled dataset.
- Strip a basic Markdown separator row.
When not to use it
- Do not use cells containing unescaped structural pipes.
- Do not expect inline-code or HTML-table parsing.
- Do not expect multiline cells or full dialect compatibility.
Worked examples
Basic table
- Input
| Name | Age |\n| --- | --- |\n| Ana | 30 |- Expected output
Name,Age\nAna,30
The separator row is discarded.
Comma cell
- Input
| Smith, Ana |- Expected output
"Smith, Ana"
The CSV cell is quoted.
No leading pipe
- Input
Name | Age- Expected output
No row
The implementation requires a leading pipe.
Common mistakes
Omitting the leading pipe
The row filter skips it. Correction: Use | at the start of each table row.
Using raw pipes in code
They are treated as columns. Correction: Avoid complex cells or use a real Markdown parser.
Expecting alignment metadata
Colon markers have no CSV equivalent. Correction: Store presentation separately.
Best practices
- Use simple one-line cells.
- Review extracted column counts.
- Open the CSV in the destination application before relying on it.
Related operations and differences
CSV to Markdown Table
Choose CSV to Markdown Table when you need to turn comma-separated rows into a Markdown table.; use Markdown Table to CSV specifically for markdown csv.
ASCII Table Generator
Choose ASCII Table Generator when you need to turn CSV rows into an aligned plain-text table.; use Markdown Table to CSV specifically for markdown csv.
Markdown Table Generator
Choose Markdown Table Generator when you need to generate an empty Markdown table with custom columns.; use Markdown Table to CSV specifically for markdown csv.
Document Link Extractor
Choose Document Link Extractor when you need to extract labeled links from Markdown or HTML.; use Markdown Table to CSV specifically for markdown csv.
HTML to Markdown Converter
Choose HTML to Markdown Converter when you need to convert common HTML elements into clean Markdown.; use Markdown Table to CSV specifically for markdown csv.
Markdown Heading Extractor
Choose Markdown Heading Extractor when you need to list heading levels and text from Markdown.; use Markdown Table to CSV specifically for markdown csv.
Limitations and privacy
- Leading-pipe rows only.
- No Markdown AST, multiline cells, inline-code awareness, or HTML tables.
- Alignment and other presentation metadata are discarded.
Document text is transformed locally in this browser.
Frequently asked questions
Are table separators exported?
No.
Are commas quoted?
Yes.
Are tables without leading pipes supported?
No.
Is alignment retained?
No.