How to Convert YAML to JSON (and Back) in Your Browser
Updated 2026-06-21
To convert YAML to JSON, paste your YAML, set From to YAML and To to JSON, and copy the result. The same tool reverses the conversion and adds TOML, so you can move config between all three formats in either direction without installing anything.
Convert YAML to JSON in three steps
- Open the YAML ⇄ JSON ⇄ TOML converter and paste your YAML into the input pane (or drag in a .yaml, .yml, .json or .toml file — it's read locally and never uploaded).
- Set From to YAML and To to JSON. The output pane updates as you type.
- Choose an indent of 2 or 4 spaces, then copy the JSON or download it as a .json file.
The same flow works for every pairing. To go the other way — JSON to YAML — flip the pickers, or press Swap to exchange the From and To formats and push the previous output back into the input for a quick round-trip.
A worked example
Say you have this YAML:
- name: toolsdeck
- version: 1.0.0
- features: a list of json, yaml, toml
Converting it to JSON gives an object with a name string, a version string, and a features array holding those three values. Switch To to TOML and the same data comes out as a flat TOML table with a features array. The tool also shows live byte and line counts for both panes, which is handy when you're checking that a minified JSON blob really did shrink after conversion.
If you're not sure which format you pasted, turn on Auto-detect input. When the input is genuinely ambiguous — for example a bare key-equals-value line that reads as both TOML and YAML — it asks you to confirm rather than guessing silently.
Common pitfalls
- TOML needs an object at the root. TOML can't represent a bare array or a single value at the top level, so converting a JSON array straight to TOML won't work. Wrap it in a named key first (give the array a property name), then convert.
- YAML anchors and aliases don't survive. YAML anchors (the ampersand-name references) and their aliases are resolved during parsing, meaning the referenced data gets inlined. The converted output stays correct but loses the anchors and can grow larger. The tool flags this when it happens.
- Indentation only affects YAML and JSON. The 2-or-4-space control changes how those two formats are written; TOML output uses its own standard layout.
Why do it here
Config files often hold secrets — API keys, hostnames, tokens. Because this converter runs entirely in your browser with no server round-trip, your YAML, JSON and TOML never leave your machine. There's no upload, no signup, and no log.
Ready to convert? Open the YAML ⇄ JSON ⇄ TOML converter and paste your data to get started.