YAML / JSON Converter
Convert between YAML and JSON formats. Toggle direction to go either way.
Related tools
Convert between YAML and JSON in either direction in your browser. YAML is easy for humans to read and edit, while JSON is ideal for code — switch between them instantly.
Frequently asked questions
What’s the difference between YAML and JSON?
They represent the same data; YAML uses indentation and is friendlier to write by hand, while JSON uses braces and is the standard for APIs.
Does it keep my data types?
Yes for strings, numbers, booleans, null, lists and nested objects. Two YAML-only cases change: dates such as 2024-01-31 become date-time strings (2024-01-31T00:00:00.000Z), and numbers written in hex such as 0x1F become plain numbers (31).
Why does my YAML fail to convert?
YAML is indentation-sensitive; inconsistent spacing or tabs are the most common cause of parse errors.
Are YAML comments and anchors kept?
No. Comments are dropped, because JSON has no comments. Anchors and aliases (&name and *name) are expanded into full copies of the data. Going from JSON to YAML, the output uses two-space indentation, keeps the key order, folds long text at 120 characters and writes no anchors.