AZ Tools

Markdown Frontmatter Parser

File

Static-site frameworks (Astro, Hugo, Jekyll, Next.js MDX, Gatsby) all put metadata in a fenced block at the top of each `.md` / `.mdx` file. This tool detects whether that block is YAML (`---`), TOML (`+++`), or JSON (`{...}`), parses it into a JSON object you can copy into a CMS migration script, and shows the rest of the file as the body with word/char counts. The parser is intentionally simple — flat keys, primitive values, bracket arrays, basic block arrays — so it handles 95% of real frontmatter without dragging in a full YAML library.

How to use

  1. Drop a `.md` / `.mdx` file or paste raw text starting with `---` (YAML), `+++` (TOML), or `{` (JSON).
  2. The fenced block is parsed into a field table and a JSON object below.
  3. The body underneath gets shown separately — copy it to feed a content pipeline that doesn't need the frontmatter.

Frequently asked questions

Does it support nested objects or anchors?
It handles flat keys, primitive values (string, number, bool, null), bracket arrays, and YAML block arrays. Complex nesting, references, anchors and multi-line strings need a full YAML library — for those, parse with `js-yaml` or your framework's loader.
What if there's no frontmatter?
The whole input is treated as the body. You'll see a hint saying no frontmatter was detected, and the body / word count still works.

Related tools