Markdown frontmatter extractor
Separate supported JSON or YAML frontmatter from Markdown and verify that the remaining body bytes stay unchanged.
- 1Add input
- 2Review and run
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Move content metadata without reformatting the article body. Export metadata as JSON, preserve the exact body boundary, and retain a SHA-256 report for checking.
How to use this tool
- Open the content file or paste text with a supported file-start metadata header.
- Extract and inspect metadata.json, the detected format and exact body boundary. No header returns empty metadata and the full body.
- Download body.md and the extraction report together. Compare the SHA-256 if the body must survive a migration unchanged.
Supported inputs and limits
One UTF-8 file or pasted text up to 1 MiB; a selected file takes precedence. JSON metadata must be a file-start object. YAML starts with --- at column zero and closes with --- or ... at column zero. TOML frontmatter is unsupported.
JSON extraction ends after the first complete root object and consumes one immediately following line ending as separator. YAML extraction consumes the closing marker and its line ending. A leading UTF-8 BOM is skipped for header detection; without a header the full original body, including BOM, stays unchanged.
The local safe YAML subset supports mappings, arrays, ordinary scalar values, quoted/flow values and basic block scalars. Tags, anchors, aliases, merge keys, multiple documents and non-finite numbers are rejected. Metadata must be an object; comments and metadata formatting are not retained in JSON.
Body text after the boundary is not parsed, rendered or executed, including MDX. body.md retains its UTF-8 bytes and line endings. The report provides boundary offsets, body byte count and SHA-256; pasted textarea input may already have LF-normalized endings. Open a file when original CRLF bytes matter.
Worked example
Example input
{"title":"Demo","nested":{"n":1}}
# Body
endExample options
{"params": {}}Example output
{
"title": "Demo",
"nested": {
"n": 1
}
}When something does not work
Fix the opening/closing marker or JSON syntax, keep metadata as an object and replace unsupported YAML constructs with explicit values. Open the original file to preserve CRLF and remove it before using pasted text.
Frequently asked questions
Will the Markdown body be reformatted?
No. It is copied after the detected boundary; fences, braces and blank lines in the body are left intact.
What if there is no frontmatter?
Metadata is {} and the entire original text is the body, including a leading BOM.
Does it run MDX or YAML tags?
No. The body is not executed and YAML tags are rejected. This is a content split, not a site build.
Documentation & further reading
Related tools
JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
Regex tester
Try a pattern and see what it matches in your text.
Compare text
See what changed, side by side.
HTML formatter
Format HTML indentation so its structure is easier to read.