JSON to YAML Converter

Get YAML that is valid and readable, with quoting handled correctly.

JSON input
YAML output

About this tool

Convert JSON to YAML in your browser. Objects become mappings, arrays become lists, and the output is valid YAML 1.2 with indentation you choose.

Strings that would change meaning in YAML — true, 123, - item — are quoted automatically, so "true" comes back as the string you wrote, not a boolean. This is the single most common bug in JSON→YAML converters, and it is handled per the YAML 1.2 core schema rules.

Integers larger than 2⁵³−1 are written as quoted strings, because every YAML-to-JSON consumer that reads them as a number would round them. The notes under the output say when this happened.

How to use it

  1. Paste your JSON, or drop a .json file onto the input pane.
  2. Pick the indentation — 2 spaces is the convention; 4 is there for configs that use it.
  3. Copy or download the YAML. Anything the converter decided on your behalf is stated in the notes.

Worked example

A value that reads true or 123 in JSON is quoted in the YAML so it round-trips as the string it is; a plain value stays plain. The sample converts with host and port bare and the list indented under server.

Quoting done right

Frequently asked questions

Is JSON to YAML lossless?
Going out, yes: every JSON value has a YAML spelling, and this tool quotes the ambiguous ones. Coming back is lossy in one direction only — YAML files can express things JSON cannot (anchors, tags, non-string keys), and the YAML to JSON tool reports those honestly.
Why are some strings quoted and others not?
A bare word like Oslo means the same thing quoted or not, so it stays bare for readability. But true, 123, null or - item would change meaning if left bare, so they are quoted. That rule set is the core of YAML 1.2.
What happens to my 19-digit ids?
They become quoted strings, and the notes say so. A YAML consumer reading them as numbers would silently round them; a string keeps every digit. If your target system needs numbers, keep the ids shorter than 16 digits.
Does it support YAML anchors?
Going out, no — anchors are a YAML authoring feature, and generating them from JSON would surprise every downstream reader. Coming back (YAML to JSON), anchors and aliases are fully resolved.
Is my data uploaded anywhere?
No. Conversion is local; a dropped file is read in the tab and never sent anywhere.