Toolium

JSON to YAML Converter

Convert between JSON and YAML formats instantly

100% client-sideFree, no signup

JSON and YAML, and when to move between them

JSON and YAML hold the same data types: objects, arrays, strings, numbers, booleans, and nulls. For the data this tool handles, the differences are mostly stylistic. YAML leans on indentation instead of braces, drops quotes where it can, and allows comments, while JSON is stricter, more verbose, and parsed natively by every language. The tool converts both directions and preserves structure, so a round trip returns your data unchanged.

Which one fits the job

  • JSON for APIs. Every language ships a fast parser, and the strict syntax leaves less room for surprise on the wire.
  • YAML for config. People write and read it by hand, and comments let a config explain itself, which a comment-free JSON config never can.
  • Follow the ecosystem. Kubernetes, Docker Compose, and GitHub Actions settled on YAML for that reason, so convert toward whatever the surrounding tools expect.

The Norway problem, and how the tool dodges it

YAML carries famous footguns. The bare word no parses as the boolean false (the Norway problem, since the country code NO reads as false), an unquoted date turns into a date object, and indentation has to stay consistent inside a block. The converter quotes any string that looks like a boolean, number, or date, so your values keep their type across the round trip, and it targets YAML 1.2 to sidestep the 1.1-era yes and no booleans.

Round-trip questions

Are comments preserved?
JSON has no comments, so YAML-to-JSON drops them, and JSON-to-YAML has nothing to add. Keep comments by editing the YAML output by hand after conversion.
How are multi-line strings handled?
YAML output uses block scalar style with the pipe character for strings that contain newlines, which stays readable. The JSON side stores the same newlines as backslash-n escapes, and both parse back to the identical string.
Why did some numbers come out quoted in YAML?
Because the JSON value was a string of digits, not a number. The converter keeps the type distinction, so a JSON string 123 becomes a quoted YAML 123 while a JSON number 123 stays unquoted.