JSON → YAML

Convert JSON to readable YAML with configurable indentation.

Private by design. Your input never leaves this browser. Conversions run locally on your device.

What this tool handles

  • Indentation of 2 or 4 spaces. Output is always block style, never flow style.
  • Keys can be sorted alphabetically instead of keeping their original order.
  • Repeated structures are written out in full; no anchors or aliases are emitted.
  • Strings that YAML would otherwise read as numbers, booleans or dates are quoted.

Example

JSON

{"name":"Ada","active":true,"ports":[80,443]}

YAML

name: Ada
active: true
ports:
  - 80
  - 443

When you would use it

  • A Kubernetes manifest back into the repo — kubectl get deployment -o json gives you the live object; this turns it back into the YAML shape a manifest file is expected to have.
  • Writing a Docker Compose file — A compose definition assembled in a script is easier to build as JSON. Convert it once at the end so the checked-in compose.yaml stays hand-editable.
  • Config for a Spring or Rails app — Take a settings object you already have as JSON and emit the application.yml form, with nesting rather than dotted keys.
  • Seeding a Helm values file — Turn the default values an operator emits as JSON into the values.yaml a chart consumer will read and comment.

Common questions

Why did a long string get wrapped across lines?

Output folds at 120 columns, so a long value becomes a >- folded block. A single token with no spaces in it cannot be folded and is left on one line.

How is a string containing newlines written?

As a | literal block, so a shell script or a certificate stays readable line by line instead of collapsing into one quoted string full of \n escapes.

Does "Sort keys alphabetically" apply to nested objects?

Yes, it sorts at every level, not just the top one. Leave it off to keep the original JSON key order.

Does the compact indentation choice produce flow style?

No. YAML output here is always block style, and the compact choice falls back to two spaces, so it gives the same result as the 2-space choice. Pick 4 spaces if your linter wants them.

Related tools

  • YAML → JSON — Parse YAML and emit pretty-printed JSON.
  • Convert any format — Pick an input format and an output format and convert between any pair.
  • JSON → TOML — Convert a JSON object to TOML.
  • TOML → JSON — Parse TOML configuration into JSON.
  • JSON → CSV — Turn an array of objects into a CSV table.
  • CSV → JSON — Parse CSV or TSV into JSON, with delimiter detection and optional type coercion.

Browse all 25 tools