Convert YAML to JSON
Convert YAML to JSON in your browser: load your YAML, choose JSON as the target, and download the result. This conversion preserves every value in your data, and nothing is uploaded to a server.
Convert YAML to JSONRuns in your browser. Nothing uploaded.
When you need this
Almost every parser, schema validator and HTTP API speaks JSON. When a tool rejects your YAML — a CI step, a linter, an SDK that only accepts a JSON body — converting it is faster than arguing with the tool. It is also the way to find out what your YAML actually says, since anchors and merge keys are expanded in the output.
How to convert YAML to JSON
- Load your YAML
- Drag the .yaml or .yml file in from the repository you are working in. Indentation is preserved exactly as written, so a paste from a terminal works too. Nothing leaves your browser at this or any later step.
- Choose the target format
- Press Ctrl+Shift+K (Cmd+Shift+K on a Mac) to open the conversion panel, then pick JSON as the target. The source and the result sit side by side.
- Read the loss report
- The panel shows whether the conversion is lossless for your particular data, and lists every value it had to transform. Adjust indentation, key sorting and null handling if you need to.
- Take the JSON
- Download the .json file, copy it, or open it as a new tab to keep working on it in the JSON views.
What survives the conversion
YAML to JSON is lossless for your data: convert back and every value returns. Formatting does not survive — comments and whitespace are lost by every conversion in every direction, in every tool.
- Anchors and aliases are expanded to their values.
&defaults/*defaultsbecomes the same content repeated at each use site: the data survives, the sharing does not, and the output can be noticeably larger than the input. - Comments are dropped. JSON has no syntax for them, so any explanation of *why* a value is what it is exists only in the YAML.
- Duplicate keys in the source resolve to the last one seen, which is what the YAML spec requires but is worth knowing before you use the JSON as the source of truth.
A worked example
An anchor expanded at its use site:
defaults: &defaults
retries: 3
staging:
<<: *defaults
host: stage.internal{
"defaults": {
"retries": 3
},
"staging": {
"retries": 3,
"host": "stage.internal"
}
}Privacy
The conversion runs in your browser — in a Web Worker for anything above a quarter of a megabyte, so the page stays responsive. Your data is not uploaded, not logged and not stored. There is no account, and the whole thing works offline.
Questions
What happens to my anchors and merge keys?
They are resolved. The <<: *defaults merge above becomes the keys it referenced, written out in place. Every value your YAML described is present in the JSON — but the JSON no longer records that two blocks shared a definition, so editing the result means editing each copy.
Is converting YAML to JSON lossless?
For the data, yes — every value survives a round trip. Formatting does not: comments, whitespace and in some cases key order are lost by any conversion between these formats. Anchors are expanded to their values and comments are dropped; the data is preserved.
Is my YAML uploaded to a server?
No. The file is read and converted by your browser. Nothing about its contents is sent anywhere, which you can verify in your browser’s network panel or by using the tool with the network disconnected.