Convert Markdown to JSON Online
Parse a Markdown pipe table into JSON: one object per row, keyed by the header. The table is read in your browser and never uploaded.
Drop a CSV or Excel file here
CSV · XLSX · XLS · XLSM · XLSB
Ready to download as a binary file.
How to convert a Markdown table to JSON
Three steps from plans.md to JSON.
1. Paste the table
Paste a Markdown pipe table or drop a .md file.
2. Check it in the grid
Check the header: the row just above the |---| separator becomes the keys.
3. Pick a shape and copy
Choose a shape and an indent, then copy the JSON or download data.json.
Example: Markdown in, JSON out
A pricing table from a README, with alignment colons, bold text, a unit in the Storage column and an escaped pipe.
| Plan | Price | Storage | Notes |
| :--- | ----: | :-----: | ------------------ |
| Free | 0 | 5 GB | **No** card needed |
| Pro | 12 | 1 TB | SSO \| SAML |[
{
"Plan": "Free",
"Price": 0,
"Storage": "5 GB",
"Notes": "**No** card needed"
},
{
"Plan": "Pro",
"Price": 12,
"Storage": "1 TB",
"Notes": "SSO | SAML"
}
]Formatting markers are part of the value: "**No** card needed" is a string with the asterisks. Strip them in the grid if you want plain text.
What changes between Markdown and JSON
Header row → keys
Each data row becomes one object, and the header text is used as the key exactly as written ("Plan", "Price", "Storage" and "Notes"). Two columns with the same header end up as one key, and the last one wins, so rename duplicates in the grid first.
Numbers and text
A cell that parses as a number is written as a JSON number, anything else as a string. Here Price comes out unquoted. A value with a symbol or unit, such as "5 GB", is not a number and stays a string.
Empty cells
An empty cell becomes an empty string (""), never null.
Header and separator
The row above the separator line becomes the header (Plan, Price, Storage and Notes). The separator is dropped, along with its alignment colons.
When to convert Markdown to JSON
- Turning a table maintained in a README or docs page into data an app can load.
- Pulling a comparison table out of Markdown notes for a script.
Markdown to JSON in JavaScript
A pipe table is easy to split by hand. Then each row is zipped with the header into an object.
import { readFile } from 'node:fs/promises';
const lines = (await readFile('plans.md', 'utf8')).split('\n').filter((l) => l.includes('|'));
const cells = (line) => line.trim().replace(/^\||\|$/g, '')
.split(/(?<!\\)\|/).map((c) => c.trim().replace(/\\\|/g, '|'));
const header = cells(lines[0]);
const rows = lines.slice(2).map(cells); // lines[1] is the separator
const records = rows.map((row) =>
Object.fromEntries(header.map((key, i) => [key, row[i] ?? '']))
);
console.log(JSON.stringify(records, null, 2));Like this page, the split skips the separator line and honours escaped pipes.
Frequently asked questions
Is the column alignment kept in the JSON?
No. The colons in the separator row only describe how the table is displayed, so they are dropped when the table is read. JSON has no notion of alignment.
Can I get an array of arrays?
Yes. Pick 2D Array in the Shape menu: the first inner array is the header and every cell stays a string, units and all.
Is bold, code or link formatting kept?
It is kept as literal text, not interpreted. **bold** keeps its asterisks and [text](url) stays as written. Clean the cells in the grid if you want plain values.
Why are some values strings and others numbers?
The converter checks each cell: if the whole value parses as a number it is written as a number, otherwise as a string. Pick the 2D Array shape if you want every value left as text.
Does plans.md get uploaded when I convert it to JSON?
No. The table is read in your browser and never uploaded.