Data Format Converter

YAML to JSON Converter

Paste YAML or open a file to get JSON. The conversion runs entirely in your browser, so config files and secrets are never uploaded.

Swap to JSON to YAML

Paste text, or drop a file here

JSON

    Example

    YAML input

    # Service settings
    service: api
    replicas: 3
    debug: false
    ports:
      - 8080
      - 8443
    env:
      region: eu-west-1

    JSON

    {
      "service": "api",
      "replicas": 3,
      "debug": false,
      "ports": [
        8080,
        8443
      ],
      "env": {
        "region": "eu-west-1"
      }
    }

    How it handles tricky cases

    Yes, no, on, off

    This converter follows YAML 1.2, where only true and false are booleans. Tools built on YAML 1.1, including PyYAML, read yes, no, on and off as booleans, so results can differ.

    Dates

    Dates like 2001-12-14 stay text rather than being converted to a timestamp.

    Anchors and aliases

    Aliases are expanded, so the JSON contains a full copy of each referenced value.

    Multiple documents

    Documents separated by --- are combined into one JSON array, and a note says how many were found.

    Comments

    JSON has no comments, so YAML comments are not carried over.

    Do it from code

    Command line with yq:

    yq -o=json '.' in.yaml > out.json

    Questions

    Why do I get an indentation error?

    YAML doesn't allow tabs for indentation, and items at the same level must line up. The error message gives the line number.

    Is it safe to paste secrets?

    The page doesn't send your input anywhere, but it's still good practice to rotate any secret that has been pasted into a tool you don't control.

    Does it keep key order?

    Yes. Keys appear in the same order as in the YAML, apart from keys that look like integers, which JavaScript sorts first.

    Related tools