Developer Tools

JSON to YAML

Convert JSON into readable YAML 1.2 locally. Preserve number spellings and string values, choose space indentation, then copy or download YAML without uploading data.

Your content stays on your device Free, with no account
Readable YAML without changing JSON value types Converted on your device
Up to 200,000 UTF-16 units, 50,000 JSON tokens and 100 nested containers. Duplicate keys are rejected.

Strings and keys use double quotes to preserve their types. Number spellings stay intact; there is no JavaScript Number round trip. YAML indentation uses spaces.

YOUR YAML

Ready. Paste JSON and choose indentation.

Output uses block collections, quoted strings and a final line break. Empty objects and arrays stay {} and []. Numeric range and precision in other YAML programs can vary.

A FEW SIMPLE STEPS

How to use JSON to YAML

  1. Paste valid JSON or load the example with a large integer, a leading-zero string and nested values.
  2. Choose two or four spaces for YAML indentation.
  3. Select Convert to YAML. Review errors or the quoted-string block-style output.
  4. Copy or download YAML. Editing text or indentation clears the previous output.
PRIVATE BY DESIGN

Why use this tool?

Your data stays on your device. The existing local JSON validator checks syntax, and a token-based emitter creates YAML without converting numeric tokens into JavaScript Number values. No uploads, accounts, dependencies, saved input history or executable YAML tags are involved.

Tool inputs stay in your browser. Only your theme preference is saved on this device.

A few things worth knowing

Are large numbers and decimal spellings preserved?

Yes. JSON numbers are emitted from their original validated tokens, including large integers, exponent spelling, negative zero and decimal trailing zeros. They are never converted to JavaScript Number values. YAML programs that consume the file may still apply their own numeric precision or range limits. Quote numeric IDs in the input JSON when they must remain text.

Why are strings and property names double-quoted?

Quoting preserves JSON string types and protects text that resembles YAML booleans, nulls, dates, numbers, tags or aliases. JSON escapes are decoded and the string is re-escaped for YAML-compatible double quotes; unusual control and separator characters are escaped explicitly. Values remain the same, although escape spellings may change. Multiline strings use escaped line breaks, not YAML literal blocks.

What YAML output style is used?

YAML 1.2 core-compatible block mappings and sequences, with two or four spaces. Strings and keys are double-quoted. Empty objects and arrays use {} and [], top-level scalar values are supported, and the file ends with LF. No tags, aliases, anchors or document directives are generated. Member and array order follows the JSON source.

What JSON is rejected?

Invalid JSON, comments, trailing commas, duplicate object keys and over-limit input are rejected without partial output. JSON strings containing unpaired surrogate units are also rejected because YAML requires Unicode scalar values. Object keys such as __proto__ remain data and are never assigned to a JavaScript object. This is syntax conversion, not application-schema validation.

Does it require the YAML parser or a server?

No. Conversion uses the site’s shared JSON tokenizer and a local emitter for a deliberately simple YAML subset. Output is tested with the self-hosted yaml parser used by YAML to JSON. Nothing is fetched, executed, uploaded or saved in browser storage. The reverse converter has its own documented limits for aliases, merge keys and non-finite numbers.

What are the limits and reset behavior?

Input accepts 200,000 UTF-16 units, 50,000 JSON tokens and 100 nested containers. YAML output is limited to 1,000,000 UTF-16 units; use shorter input or two-space indentation if expansion is too large. Clear keeps indentation, while Try an example restores two spaces. Input or option changes clear old results and disable copy/download until conversion succeeds.