JSON to YAML Converter
Convert JSON to YAML online for free. Keeps long IDs and version numbers exact, quotes values YAML would misread, and runs entirely in your browser.
Runs in your browserNothing uploadedFree · no signup
Numbers keep their exact digits, so long IDs and versions like 1.50 are not rounded or trimmed. Values that YAML would otherwise read as something else — NO, yes, off, 017, 1:30, a date — are quoted so they stay strings, and multi-line text is written as a block scalar.
Frequently asked questions
- Why are some of my values wrapped in quotes?
- Because unquoted YAML is typed by shape, and a handful of ordinary strings would come back as something else. The country code NO and the words yes, no, on and off are read as booleans by YAML 1.1 loaders such as PyYAML and Ruby's Psych - the famous 'Norway problem'. Values like 017, 0x1F, 1_000, 1:30 and 2026-08-25 are read as an octal number, a hex number, a thousand, ninety seconds and a date. Anything that would be re-typed like this is quoted so it stays the exact string your JSON had.
- Will a long ID or a version number like 1.50 change?
- No. The converter reads each number straight out of your JSON text and writes those same digits back, so a 20-digit identifier keeps every digit and 1.50 stays 1.50. That is worth knowing because the obvious approach does not: JavaScript's own JSON.parse rounds 12345678901234567890 to 12345678901234567000 and rewrites 1.50 as 1.5. The one change made on purpose is to exponent numbers - 1e5 is written as 1.0e+5, because the YAML 1.1 resolver reads a bare 1e5 as a string rather than a number.
- How are multi-line strings converted?
- As a literal block scalar - the key, then a | marker, then the text indented beneath it - which is how multi-line values are meant to look in YAML and stays readable in a diff. A block scalar cannot represent every string exactly: if a line ends in a space, or the text begins with one, the converter falls back to a double-quoted string, which is always exact because YAML's double-quoted style is a superset of a JSON string.
- What happens if my JSON has duplicate keys?
- The last value for a repeated key is kept, matching what JSON.parse and most parsers do, and the tool tells you how many duplicates it found so the collision is not silent. YAML has no way to write the same key twice in one mapping, so keeping both is not an option.
- Is my JSON uploaded anywhere?
- No. The conversion runs entirely in your browser and nothing is sent to a server, so you can convert a config file holding hostnames, tokens or connection strings without it leaving your device.