YAML to JSON Converter
Paste YAML to get JSON, or switch direction to turn JSON into YAML. The output updates as you type, and errors point to the line and column to fix.
- Runs on your device
- No sign-up
- Free, no watermark
How to use the YAML to JSON Converter
- 01Choose YAML to JSON or JSON to YAML.
- 02Paste your text, or open a .yaml, .yml or .json file (you can also drop it onto the input). Opening a file picks the direction for you.
- 03Pick the indent and, if you like, sort keys alphabetically.
- 04Copy the result or download it as a .json or .yaml file.
Good to know
Runs on your device
Config files, secrets and API specs are converted in your browser and never uploaded.
Both directions
YAML to JSON and JSON to YAML. One button moves the output into the input to go back.
Real-world YAML
Anchors, aliases, << merge keys and multi-document files (---) are supported.
Precise errors
Invalid input shows the line and column, and can put your cursor right on it.
Frequently asked questions
Is my YAML or JSON sent to a server?
No. Conversion runs in your browser with the open-source yaml library, so files with passwords or keys stay on your device.
What happens to comments?
JSON has no comments, so they're dropped when converting YAML to JSON. The status bar tells you when that happens. Converting JSON to YAML can't add any.
How are anchors and aliases handled?
Each alias (*name) is replaced by a full copy of the anchored value, and << merge keys are applied, because JSON has no references. Key order is kept as written.
My file has several documents separated by ---. What do I get?
A JSON array with one item per document, in order. A trailing --- with nothing after it is ignored.
Why are some strings quoted in the YAML output?
Values such as "yes", "on", "1_000" or "2024-01-01" are quoted so that older YAML 1.1 readers, such as PyYAML, keep them as text instead of turning them into booleans, numbers or dates.
Are big numbers kept exactly?
Yes. Integers too large for JavaScript, such as 12345678901234567890, keep every digit in both directions.