Markdown to JSON Converter Online

Parse Markdown into a structured JSON tree — headings become nested nodes, lists become arrays, tables become arrays of objects. 100% in your browser.

What is a Markdown to JSON converter?

A Markdown to JSON converter parses a Markdown document into a structured JSON tree. Each heading becomes a node with a children array; sub-headings nest inside their parent; lists become string arrays; tables become arrays of objects keyed by column header; code blocks preserve their language and verbatim text.

JSON is the easiest format to consume programmatically. Once your README, blog post, or wiki page lives as JSON, you can index it, transform it, slice it by heading, generate a table of contents, or feed it to an LLM as structured context. The converter is the bridge between human-friendly Markdown and machine-friendly JSON.

How to convert Markdown to JSON — 4 steps

  1. Paste Markdown. Drop a README, doc page, or any .md source into the left pane.
  2. Read the JSON tree. Heading hierarchy is reflected as nested children; tables become record arrays.
  3. Tweak the source. Add or rearrange headings to reshape the tree.
  4. Copy. Click Copy JSON and feed the result into a static-site build, an API, or an LLM prompt.

Sample input and output

# Title

Some intro text.

## Items

- one
- two
[{
  "type": "heading",
  "level": 1,
  "text": "Title",
  "children": [
    { "type": "paragraph", "text": "Some intro text." },
    { "type": "heading", "level": 2, "text": "Items", "children": [
      { "type": "list", "ordered": false,
        "items": ["one", "two"] }
    ]}
  ]
}]

Heading Hierarchy

H1 contains H2 contains H3 — the JSON tree mirrors the heading levels exactly, so slicing by section is one array index away.

Tables as Records

Markdown tables become arrays of objects keyed by column header — drop directly into a database, spreadsheet, or API.

Code Block Preservation

Fenced code blocks keep their language tag and verbatim text — easy to extract for syntax highlighting downstream.

Common use cases

  • check_circleImporting README content into a CMS, knowledge base, or headless API
  • check_circleGenerating a table of contents from heading nodes
  • check_circleSlicing long docs by section for incremental rendering
  • check_circleFeeding structured docs into an LLM as RAG context
  • check_circleExtracting tables from release notes for downstream automation
  • check_circleBuilding a search index from blog posts written in Markdown
  • check_circlePowering custom static-site generators that need the AST
  • check_circleMigrating Obsidian, Logseq, or Bear notes into a structured format

Comparing Markdown ASTs

Mature parsers (remark, markdown-it, mdast) produce richer ASTs with detailed position info, inline node trees, and extension hooks — at the cost of a heavier output. This converter is intentionally compact: a small, readable JSON shape that maps to the things most consumers actually need (heading levels, list items, table rows, code blocks). Use it for content workflows; reach for a full AST library when building parsers or linters.

More Markdown tools

Render, convert, and format Markdown — all browser-side.

Frequently Asked Questions

Why convert Markdown to JSON?

A JSON tree of a Markdown document is structured data — searchable, transformable, and easy to feed into a static-site generator, a CMS importer, or an AI prompt. Converting README files, blog posts, and documentation to JSON unlocks the data inside without losing the source format.

What is the JSON structure produced?

The root is an array of nodes. Each heading becomes { type: "heading", level, text, children: [...] } and the children array contains everything between this heading and the next same-or-higher level heading. Lists become { type: "list", ordered, items }. Tables become { type: "table", columns, rows } where rows is an array of objects keyed by column header. Code blocks become { type: "code", lang, text }. Paragraphs and blockquotes use their respective shapes.

Are nested headings reflected as nested children?

Yes. An H2 inside an H1 becomes a child of the H1 node. An H3 inside that H2 becomes a child of the H2. The tree mirrors the heading hierarchy you would see in a table of contents — making it easy to render docs as a sidebar or to slice a document by section.

How are GitHub tables handled?

GFM tables are detected by the |---| separator row. The header row supplies column names, and each subsequent row becomes an object with those names as keys. This makes Markdown tables directly usable as data — paste a release notes table and you have a list of records ready for any pipeline.

What about inline formatting in headings or paragraphs?

Inline formatting (**bold**, *italic*, `code`, links) is preserved verbatim in the text fields — the converter does not strip Markdown syntax inside text nodes. If your downstream consumer wants plain text, post-process the output to remove inline markers; if it wants Markdown, the source survives the round-trip.

Can I round-trip Markdown to JSON and back?

For the supported subset (headings, paragraphs, lists, tables, code blocks, blockquotes, horizontal rules) the round-trip is structurally lossless. Inline formatting survives because text is preserved verbatim. Edge cases like footnotes, definition lists, and raw HTML are not modeled, so they survive only as paragraph text.

Why is the output an array, not an object?

A Markdown document is an ordered sequence of blocks — order matters. JSON arrays preserve order; JSON objects do not. The top-level array reflects the document order, and each heading node carries its own children array. If you need an object keyed by heading text, post-process by reducing the array.

Is my Markdown sent to a server?

No. Parsing happens in your browser via JavaScript. Internal docs, drafts, and proprietary content never leave the device. Verify in your browser DevTools Network tab — no requests fire when you paste or load the sample.

Markdown to JSON Converter Online — Free MD to JSON Tool