Indentation

Result

Paste JSON to convert it to YAML.

How to use this tool

  • Paste JSON and choose 2 or 4 spaces of indentation.
  • The YAML updates as you type; copy it or download a .yaml file.
  • Invalid JSON is reported with its line and column.

How it works

Objects become key: value lines, arrays become - item lines, and nested values are indented. Strings are written without quotes only when that is unambiguous; anything YAML could read differently — yes, no, on, off, null, numbers such as 1.0, or text containing : or # — is double-quoted, so the YAML means exactly the same as the JSON.

Example

A small config

{"tags": ["a", "yes"], "db": {"port": 5432}} becomes

tags:
  - a
  - "yes"
db:
  port: 5432

Privacy and limitations

  • Everything runs in your browser; nothing you paste is uploaded or stored.
  • Output follows YAML 1.2. Because JSON is valid YAML, any YAML parser reads the result correctly.
  • Comments cannot be added because JSON has none.

Frequently asked questions

Why is "yes" in quotes?

Older YAML parsers read an unquoted yes as true. Quoting keeps it as the text “yes”, which is what the JSON says.

Can it convert YAML back to JSON?

Yes — use the YAML to JSON Converter.