A GitHub-flavoured Markdown table uses pipe characters to separate columns and a dashes-and-colons row to set alignment. That alignment row is great for rendering but is noise in a spreadsheet. This converter extracts only the real data and emits clean, RFC 4180-compliant CSV you can open in Excel, Google Sheets, or load into a database.
How it works
- Split the input into lines and keep the non-empty ones.
- For each line, split on unescaped pipes — a
\|is preserved as a literal pipe inside the cell — and drop the optional empty cells created by leading/trailing pipes. - Detect and remove the alignment row (cells made only of dashes, colons and spaces, like
:---:). - Trim each remaining cell.
- CSV-encode each field per RFC 4180: quote it if it contains a comma, quote, or newline, doubling any internal quotes.
Example
Input:
| Name | Role |
|------|---------------|
| Ada | Engineer |
| Alan | Mathematician |
Output:
Name,Role
Ada,Engineer
Alan,Mathematician
Notes
The first surviving row is treated as the header. Cells that hold commas or quotes are automatically wrapped and escaped, so a value like Smith, Jane round-trips correctly. Everything runs locally — your table content never leaves the browser.