JSON to YAML Converter

Or enter JSON manually below

Input & Output for JSON to YAML Converter

What input is accepted by this tool?

The input must be valid JSON. This includes objects, arrays, strings, numbers, booleans, and null values. For example,

{
    "database": {
        "host": "localhost",
        "port": 5432,
        "credentials": {
            "username": "admin",
            "password": "secret"
        }
    }
}

What'll be the output of this tool?

The output will be a valid YAML document. For example, the output of the above input will be:

database:
  host: localhost
  port: 5432
  credentials:
    username: admin
    password: secret

What inputs are considered invalid?

The following inputs will produce an error:

  • Invalid JSON syntax: Missing quotes, trailing commas, or malformed structures.
  • Unquoted keys: JSON requires all keys to be wrapped in double quotes.
  • Single quotes: JSON only supports double quotes for strings, not single quotes.

How are arrays converted to YAML?

JSON arrays are converted to YAML lists using the - prefix for each item. For example,

{
    "servers": ["web01", "web02", "db01"],
    "ports": [80, 443, 5432]
}

This produces:

servers:
  - web01
  - web02
  - db01
ports:
  - 80
  - 443
  - 5432