Front Matter Parser

Split a Markdown file into its front matter and body, and read the YAML, TOML or JSON fields as JSON.

Front matter as JSON

Paste a file above to see its front matter instantly.

No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

Paste a Markdown or MDX file and the parser splits it into two halves: the front matter block at the very top and the body content underneath. Three fence styles are recognised automatically โ€” --- for YAML (Jekyll, Hugo, Astro, Eleventy, Next.js, Gatsby, Obsidian), +++ for TOML (Hugo, Zola) and a leading {โ€ฆ} object for Hugo's JSON front matter. You can also force a format from the dropdown when a file is ambiguous.

YAML is parsed with a complete YAML 1.2 parser, so anchors, aliases, block scalars and quoted keys all behave exactly as your static site generator expects, and dates such as date: 2024-03-17 are kept as strings so they survive the round trip intact. TOML is parsed by a hand-written TOML v1.0.0 reader covering the syntax front matter actually uses: bare and quoted keys, dotted keys, tables, arrays of tables, inline tables, multi-line strings, integers in decimal, hex, octal and binary, floats, booleans and date-times (date-times are kept as strings so they survive the round trip). JSON front matter is read with the browser's own RFC 8259 parser.

The Fields table flattens nested keys into dotted paths so you can check at a glance whether author.name or params.layout really made it into the build. Everything runs in JavaScript on your own device โ€” drafts, client names and unpublished posts never leave your browser, and there is no upload, signup or ad.

Frequently asked questions

What is front matter in a Markdown file?

Front matter is a small block of metadata at the very top of a Markdown or MDX file that tells your static site generator about the page: its title, date, tags, draft status, layout and so on. It sits above the body content and is fenced off from it, most often by a pair of --- lines holding YAML. Hugo and Zola also accept +++ fences holding TOML, and Hugo accepts a leading JSON object in braces. This tool recognises all three fence styles, splits the metadata from the body, and shows you exactly what your build will see.

Which front matter formats does the parser support?

YAML between --- fences (Jekyll, Astro, Eleventy, Next.js, Gatsby, Obsidian), TOML between +++ fences (Hugo, Zola) and Hugo's JSON front matter written as a leading braces object. The format is detected from the opening fence automatically, and you can override the guess from the dropdown when a file is ambiguous. YAML is read by a complete YAML 1.2 parser, so anchors, aliases, block scalars and quoted keys behave exactly as your generator expects. TOML is read by a hand-written TOML v1.0.0 reader covering tables, arrays of tables, inline tables, dotted keys, multi-line strings, date-times and numbers in decimal, hex, octal and binary. JSON is read by the browser's own RFC 8259 parser.

Is my Markdown file uploaded anywhere?

No. The whole parser is JavaScript that runs inside your browser tab, so the file you paste never travels over the network. That matters because front matter is usually where unpublished drafts, client names, internal slugs and scheduled dates live. There is no upload, no signup, no account and no ads, and you can keep using the page with your network disconnected.

Report a bug