YAML ⇄ JSON Converter - For Everyday Config Files
Config files live in YAML; APIs and code live in JSON. Paste either one below to get the other - with an honest subset parser that handles the constructs real-world configs actually use.
How to use the YAML to JSON Converter
- Paste YAML or JSON into the top box.
- Click YAML → JSON or JSON → YAML depending on your input.
- Review the result - YAML input becomes pretty-printed JSON; JSON input becomes clean block-style YAML.
- Copy the result or download it.
How it works
The YAML reader works in two passes: it first normalises your document into lines with their indentation (stripping comments outside quotes), then recursively parses blocks - a run of lines at the same indent is a list if the lines start with a dash, a map if they carry keys, or a single scalar. Keys with no value on the same line take the deeper-indented block that follows as their value. Scalars are typed the YAML way: quoted text stays a string, true/false become booleans, null and ~ become null, and plain numbers become JSON numbers. The writer in the other direction emits the same subset: two-space indentation, dashes for lists, and quotes only where a string would otherwise be misread.
Worked example
A docker-compose style fragment - a service name, an image, a list of two ports - converts to a JSON object with a nested map and a real array, and converting that JSON straight back returns the same YAML, which is exactly the round-trip the test suite checks.
Frequently Asked Questions
Is this YAML to JSON converter free?
Yes - completely free, with no sign-up, no size limit and no daily cap.
Which YAML features are supported?
The everyday subset: nested maps by indentation, lists with dashes (including lists of maps), quoted and plain scalars, numbers, booleans, null, and comments. This covers the large majority of hand-written config files.
Which YAML features are NOT supported?
Anchors and aliases (&a / *a), multi-line block scalars (| and >), flow style ({a: 1} / [1, 2]), tags, and multi-document files (---) are not parsed. If your file uses them, convert with a full YAML library instead - we would rather say so than produce a wrong conversion.
Does JSON → YAML quote strings?
Only when needed: a string that looks like a number or boolean, is empty, or contains characters such as a colon followed by a space is double-quoted so it reads back as the same string.
Is my data uploaded to a server?
No. Converting happens 100% in your browser. Your config files never leave your device.
Related Developer Tools
JSON Formatter
Validate, pretty-print and minify JSON, with the exact position of any error.
CSV to JSON Converter
Convert CSV to a JSON array of objects - a real parser that handles quoted commas and escaped quotes.
JSON to CSV Converter
Turn a JSON array of objects into a clean CSV file - union of all keys, proper quoting, one click.