Markdown Metadata Generator
Markdown Metadata Generator turns a JSON object into YAML front matter wrapped in --- lines, ready to paste at the top of a Markdown file for Jekyll, Hugo, Eleventy and similar tools. Your JSON is checked in the browser, then converted on the server by the Symfony YAML component. Copy the block or download it as markdown-front-matter.md.
Use Markdown Metadata Generator
Markdown Metadata Generator
Convert a JSON object into clean YAML front matter for Markdown documents.
Input JSON Object
Output Front Matter
Read Content
Turn a JSON object into YAML front matter
Markdown Metadata Generator builds the metadata block that sits at the very top of a Markdown file. You give it a JSON object, for example the fields your blog post or documentation page needs, and it returns the same data written as YAML between two --- lines. That block is called front matter, and it is how static site generators and Markdown-based content systems learn a page's title, date, tags, author, layout and any other field you define.
Writing front matter by hand is easy to get slightly wrong. YAML cares about indentation, colons inside values can break parsing, and a date or a word like yes may be read as a different type than you meant. Starting from JSON, which most developers already produce from scripts, APIs or a CMS export, and letting a real YAML library do the formatting removes most of those small mistakes.
Where front matter is used
Front matter is read by tools such as Jekyll, Hugo, Eleventy, Astro, Docusaurus, Gatsby and many headless or flat-file CMS platforms. Typical uses include:
- Blog posts:
title,date,author,tags,draft. - Documentation pages:
sidebar_position,slug,description. - Changelogs and release notes:
version,released,breaking. - Note-taking vaults:
aliases,created,status.
The tool does not know which generator you use and does not add any fields of its own. It writes exactly the keys you supply, in the order you supply them.
What happens when you click Generate
This is the one tool in the Markdown family that relies on the server for its main job. Your browser first checks the input locally: it must be valid JSON and it must be an object (curly braces), not an array, a string or a number. The Input status card shows "Waiting for JSON", "Invalid JSON", "JSON must be an object" or "Valid JSON object", and the footer counts the top-level keys.
When the input is valid, the object is sent to the site's API as the data field. On the server, the Symfony YAML component converts it, and the result is wrapped in --- lines and returned to the page. The endpoint returns the YAML and does not save your data; it is rate-limited like the site's other tool endpoints. If you are working with confidential values, remember that they do leave your device for this step.
How values are written
The formatting follows fixed settings in the code, which explains most of what you will see in the output:
| JSON input | YAML output | Why |
|---|---|---|
"title": "Hello: World" | title: 'Hello: World' | A colon followed by a space would break YAML, so the value is quoted. |
"date": "2024-05-01" | date: '2024-05-01' | A string that looks like a date is quoted so it stays a string. |
"draft": false | draft: false | Booleans and numbers keep their type. |
"tags": ["a", "b"] | a block list with - a and - b | Lists are written one item per line. |
"summary": "line1\nline2" | summary: |- followed by indented lines | Multi-line strings use a literal block. |
"empty": [] | empty: {} | An empty list becomes an empty mapping (see limitations). |
Indentation is two spaces per level. Nesting is written in block style for the first four levels; anything deeper is written inline in flow style, such as b: { c: 1 }. Some keys that YAML 1.1 parsers treat as special words, such as n or y, are quoted.
Step-by-step
- Prepare a JSON object. Example:
{"title": "Launch notes", "date": "2026-03-02", "tags": ["release", "product"], "draft": false}. - Paste it into the Input JSON Object editor, or click Paste JSON to read it from your clipboard.
- Look at the Input status card. Fix any syntax error until it says "Valid JSON object".
- Click Generate. The button shows "Working" while the request is in flight.
- The YAML appears in Output Front Matter, and the Generated output card shows the line count.
- Click Copy Front Matter and paste it at the very top of your Markdown file, or click Download to save it as
markdown-front-matter.md. - Copy Input copies your JSON back out; Clear empties both editors.
Example output
For the JSON above, the generated block is:
---title: 'Launch notes'date: '2026-03-02'tags: - release - productdraft: false---
The YAML library is cautious with strings: a title containing a space is single-quoted, and the date is quoted because it looks like a date. Single words such as release are left bare. Both forms are valid YAML and read the same way.
Good habits
- Use the field names your generator expects. Hugo, Jekyll and Docusaurus each document their own keys. The tool will not rename
datetopubDatefor you. - Decide how you want dates typed. Because date-like strings are quoted, your site will receive a string. Most generators parse it fine, but if you need a native timestamp, remove the quotes after pasting.
- Put the block first. Front matter only works when
---is the first line of the file, with nothing before it, not even a blank line. - Generate from scripts. If you export posts from a database or spreadsheet, produce one JSON object per post and run each through the tool to check how it will look.
Things to avoid
- Do not paste a JSON array of several posts. The input must be a single object; arrays are rejected before anything is sent.
- Do not paste existing YAML or Markdown. The input is parsed as JSON only.
- Do not send an empty object
{}. The API requires at least some data and responds with an error. - Do not include passwords, API keys or private customer data. The object is processed on the server.
Limitations
- Empty arrays become empty mappings. JSON
[]is decoded on the server as an empty PHP array, which cannot be told apart from an empty object, so it is written as{}. Change it to[]by hand if your generator expects a list. - Deep nesting is inlined. Levels beyond the fourth are written in compact flow style. It is valid YAML, just less readable.
- No comments. JSON has no comments, so the output has none either.
- No validation against a schema. The tool checks JSON syntax, not whether your fields make sense to your site.
- Needs a connection. Because generation uses the API, it will fail if you are offline; a toast shows the error message.
Related tools
Once the front matter is in place you can check how the body renders with Markdown Previewer, which hides the front matter block and shows only the content, or tidy blank lines in the body with Markdown Remove Empty Lines.
Frequently Asked Questions
FAQ
Comments (0)
Describe the issue you encountered so we can investigate and improve the tool.