Markdown Table to CSV & JSON Converter
Developers and analysts regularly find the data they need already formatted as a Markdown pipe table inside a README, a Notion export, or a wiki page, then waste time rebuilding it for a spreadsheet or an API call. This converter parses the header, separator, and body rows in your browser and emits RFC 4180 CSV or an array of JSON objects. Escaped pipes, alignment markers, and duplicate headers are all handled before the output is written.
How the Parser Reads Pipe Tables
The converter locates the first line containing a pipe and reads contiguous pipe-bearing lines as one table. Row one becomes the header, row two is validated as an alignment separator made of dashes and optional colons, and every later line becomes a data row. Cells are split on unescaped pipes, trimmed, and unescaped so a literal \| arrives in the output as a plain pipe.
Column counts are checked on every row; a short or long row raises a message naming the offending row number instead of emitting ragged data. The CSV writer then quotes only the cells that need it, and the JSON path deduplicates header names before building one object per row. Both serializers share the same parsed table, so switching formats never re-parses the input.
CSV serialization rules
RFC 4180 quoting is applied per cell: values containing commas, quotes, or line breaks are wrapped in double quotes and internal quotes are doubled. The header row is emitted first, followed by body rows in source order, joined with \n. The result pastes cleanly into Excel, Google Sheets, Numbers, and pandas without a custom importer.
JSON object mapping
Each body row becomes an object whose keys are the header cells after deduplication. All values stay strings because Markdown carries no type information, which protects zip codes, leading-zero SKUs, and version numbers from being coerced. The array is pretty-printed with two-space indentation so diffs in code review remain readable.
Before and after: README table to spreadsheet data
| Tool | Category | Free |
| --- | :---: | :--- |
| JSON Formatter | Developer | Yes |
| CSV to JSON | Data | Yes |
| Schema Validator | SEO | Yes | Tool,Category,Free
JSON Formatter,Developer,Yes
CSV to JSON,Data,Yes
Schema Validator,SEO,Yes Use Cases
| Developer | Production | Workflow |
|---|---|---|
| Turn a README comparison table into test fixtures | Import competitor pricing tables from docs into Sheets | Convert meeting-notes tables into CRM import CSVs |
| Feed JSON rows into a script without a custom parser | Migrate wiki feature matrices into a database | Hand marketing a CSV of documented API limits |
| Verify escaped-pipe handling against your own parser | Audit published tables for missing rows before export | Bundle release-note tables into a JSON changelog feed |
Common Mistakes and Troubleshooting
Pasting a table without its separator row triggers the "second row must be the alignment separator" error; Markdown renderers sometimes hide that row visually, so copy from the raw source rather than the rendered page. A row with a different number of cells than the header fails with the row index in the message, which usually points to an unescaped pipe inside cell text.
Curly quotes and non-breaking spaces copied from Notion or Word pass through as-is and can break strict CSV consumers in Excel; replace them with plain ASCII characters before export if your downstream tool is picky. Very wide tables with trailing empty cells sometimes include an extra empty column from a dangling final pipe; the splitter drops leading and trailing empties caused by outer pipes, but genuine empty interior cells are preserved as empty strings on purpose.
Best Practices for Table Exports
Keep unique, descriptive headers before converting, because those labels become CSV column names and JSON keys. When the table will feed an API, convert to JSON so keys stay machine-readable; choose CSV when the destination is a spreadsheet or a bulk-import wizard. Escape any literal pipes in cell text with a backslash so the column boundaries stay intact.
After exporting, open the CSV once in your target spreadsheet to confirm column alignment, especially when cells contain commas. For recurring pipelines, keep the Markdown source in version control and re-run the conversion whenever the table changes, rather than maintaining a divergent CSV copy by hand. If headers will be used as programmatic keys, rename them to stable identifiers before conversion so future wording changes in the docs do not break consumers.
Markdown Table Converter FAQ
Where do Markdown tables come from in real projects?
GitHub README files, GitLab wikis, Notion exports, Obsidian notes, and generated documentation all lean on pipe tables. Data analysts often receive a spec or comparison table pasted from a README and need it inside a spreadsheet or a JSON payload without rebuilding every row by hand. This converter bridges that gap in one paste.
How does the parser treat the |---| separator row?
The second row must consist entirely of dashes with optional colons for alignment, such as ---, :---, :---:, or ---:. Colons are alignment hints for Markdown renderers and carry no meaning for CSV or JSON, so they are accepted and then ignored. Anything else in the second position raises an error instead of silently producing a corrupt table.
Can the converter handle pipes inside cell text?
Yes. A backslash-escaped pipe (|) stays inside its cell rather than acting as a column break, which is the standard Markdown escape. Plain unescaped pipes always split columns, so if your source text contains a raw pipe you need to escape it before pasting. The cell value is unescaped in the output, so CSV and JSON receive a normal pipe character.
What happens with duplicate or blank header names?
JSON keys must be unique, so repeated headers are suffixed: a second Price column becomes Price_2, a third becomes Price_3. Blank header cells get positional names such as col_3 so every field remains addressable. CSV output keeps the original header text untouched because spreadsheet columns do not require uniqueness.
How are commas and quotes escaped in the CSV output?
The CSV writer follows RFC 4180: any cell containing a comma, double quote, or line break is wrapped in double quotes, and embedded double quotes are doubled. That means a cell reading say "hi", ok is emitted as "say ""hi"", ok", which Excel, Numbers, and every standard CSV library parse back to the original text.
Does the converter upload my table anywhere?
No. Parsing, CSV serialization, and JSON stringification all happen with local TypeScript. Paste confidential pricing tables, unreleased feature matrices, or client data and nothing leaves the browser tab. There is no account, no history, and no network call in the conversion path.
Why do my JSON rows keep values as strings?
Markdown tables are text by nature; there is no type information in the source. Every cell is therefore emitted as a JSON string. If you need numbers or booleans, parse the strings in your own code or post-process the array, because guessing types from appearance would corrupt values like zip codes that look numeric but must stay text.
Related Tools
Run the conversion in reverse for documentation
Convert raw CSV files when Markdown is not involved
Flatten JSON arrays back into spreadsheet rows
Build aligned pipe tables from scratch
Check delimiters and column counts after export
Render the source table for web documentation