Free tool
YAML to JSON Converter
Convert YAML to JSON and back, entirely in your browser.
Paste YAML to get JSON, or switch direction to go the other way. It handles the things real configuration files contain: nested mappings, lists, lists of objects, quoted strings, block scalars and inline flow collections. Everything runs in your browser tab.
YAML is a superset of JSON, so any JSON is already valid YAML, but the reverse is not true and a few YAML features have no JSON equivalent at all. Anchors and aliases, tags, multiple documents in one file and merge keys are all outside what a plain conversion can express, and this converter reports them rather than guessing. Comments are dropped, because JSON has nowhere to put them.
How to use it
- Paste your YAML into the input.
- Read the JSON on the right, or switch the direction to convert JSON to YAML.
- If parsing fails, the error names the line so you can go straight to it.
- Copy the result when it looks right.
Frequently asked questions
Which YAML features are not supported?
Anchors and aliases (&name and *name), explicit tags (!!str and similar), multiple documents separated by ---, merge keys (<<) and complex mapping keys. These have no direct JSON equivalent, so rather than guess, the converter tells you which one it found and on what line.
What happens to my comments?
They are dropped when converting to JSON, because JSON has no comment syntax. This is why editing YAML in place is preferable to a round trip through JSON if the comments matter to you.
Why is my indentation an error?
YAML forbids tabs for indentation, which is the single most common cause. Editors that insert a tab silently break the file. Use spaces, and keep sibling keys at exactly the same column.
Why did my version number become a string?
Because 1.2.0 is not a number. A single dot parses as a float, so 1.2 becomes the number 1.2, while 1.2.0 stays a string. This is a frequent surprise in version fields, and quoting the value makes the intent explicit.
Is JSON valid YAML?
Yes. YAML 1.2 is a strict superset of JSON, so you can paste JSON into a YAML parser and it will work. That is why the flow syntax here, [1, 2] and {a: 1}, looks exactly like JSON.
The desktop version
YAML to JSON Converter in Toolbelt
This page does the job in a browser tab. Toolbelt is the same tool as a native Mac app, plus the things a web page cannot do.
Tools
{
"name": "Holizmi",
"tools": [
"json",
"jwt",
"base64"
],
"live": true
}{
"sub": "12345",
"name": "Henry",
"exp": 1767225600
}019bd4e2-7a10-7c3e-9f21-4a6b8d3e5c07
019bd4e2-7a11-7b8a-8e44-1c2f9a7d6b13
019bd4e2-7a12-7d5f-b0c9-7e3a1f8c2d95 1 1 one
2 2 two
3 + inserted
3 4 three- Convert a folder of config files in one run
- Validate every YAML file in a repository at once
- Preserves comments when editing YAML in place
- Works with no connection at all