Convert Markdown to JSON
Tables, front matter
or parse in code.
Extract JSON from Markdown pipe tables, parse YAML front matter to a JSON object, or get ready-to-run Python and JavaScript snippets for Markdown parsing. Three modes, one tool.
Each mode targets a different Markdown structure and use case.
Parse any GFM pipe table to a JSON array of objects. Column headers come from the first row, before the separator. Supports multiple tables in the same document. Numbers and booleans are type-coerced automatically.
| name | age | | ----- | --- | | Alice | 30 | | Bob | 25 |
[{"name":"Alice","age":30},
{"name":"Bob","age":25}]
Extract and parse the YAML front matter block from a Markdown file. The --- delimited block at the top is parsed as YAML and output as a JSON object. Optionally include the body content as a content field.
--- title: My Post date: 2024-01-15 tags: [api, json] --- # Post content here
{"title":"My Post",
"date":"2024-01-15",
"tags":["api","json"]}
Get ready-to-run code for parsing Markdown to JSON. Covers Python (python-frontmatter, pandas), Node.js (gray-matter, remark+GFM) and vanilla browser JavaScript. Each snippet handles the full workflow — read file, parse, output JSON.
import frontmatter, json post = frontmatter.loads(text) data = dict(post.metadata) print(json.dumps(data))
The four most common workflows where Markdown data becomes JSON.
Jekyll, Hugo, Gatsby, Astro and Eleventy all use YAML front matter in Markdown files to store page metadata — title, date, tags, author, slug. Mode 2 extracts that front matter as JSON — useful for build scripts, search indexes, sitemap generators and CMS migrations.
README files often contain pipe tables with project data — contributor lists, API endpoint references, config option tables. Mode 1 extracts those tables as JSON arrays — useful for generating dynamic documentation, feeding a search index or importing into a database.
Migrating from a file-based CMS (Jekyll, Hugo, Gatsby) to a headless CMS (Contentful, Sanity, Strapi) requires converting Markdown files with front matter to JSON objects that the CMS API can import. Mode 2 extracts the front matter for each file — the first step in a bulk migration script.
n8n workflows that receive Markdown content from webhooks, Notion exports or CMS APIs often need to extract structured data from pipe tables or front matter. Mode 1 or 2 gives you the JSON structure your downstream workflow nodes expect — paste a sample and verify before building the automation.
Markdown parsed in
your browser. No upload.
The table and front matter modes run entirely in JavaScript — no external library, no server round-trip. Your Markdown is parsed locally and the JSON is built in memory. The code snippets are generated statically from your language selection.
The front matter parser handles the full YAML subset used in static site generators: strings, numbers, booleans, null, arrays and nested objects — covering Jekyll, Hugo, Gatsby, Astro and Eleventy front matter conventions.
