YAML to JSON

How to use

Converts YAML config files into JSON or XML so you can see exactly how they parse. Drop the YAML file and download.

File ConvertersLocal only

Step 1 of 4: Upload

  1. 1
  2. 2
  3. 3
  4. 4

Step 1 of 4 · Upload

When to use this
  • Debugging a GitHub Actions workflow or Kubernetes manifest by seeing how it parses
  • Converting an OpenAPI spec from YAML to JSON for a tool that needs JSON
  • Feeding YAML config into a JSON Schema validator
  • Moving Docker Compose settings into a JSON-based system

Free and private. Everything runs on your own device, with no account and no uploads.

YAML is the configuration language of Kubernetes, Docker Compose, GitHub Actions, Ansible and OpenAPI specs: pleasant to write, but whitespace-sensitive and easy to get subtly wrong. Converting it to JSON shows exactly how a parser reads it, catches indentation mistakes, and produces the format that APIs, validators and many tools require. This uses a full YAML 1.2 parser, so anchors, multi-line strings and flow syntax are all handled.

Yes. &anchors and *aliases are resolved, so the JSON contains the full expanded values.

The parser follows YAML 1.2, where only true and false are booleans. The older YAML 1.1 treated yes/no/on/off as booleans, the famous "Norway problem", which is a common source of surprises.

Only single-document files are converted. Split multi-document files, such as combined Kubernetes manifests, first.

No. JSON has no comments, so YAML comments are dropped.

How it works
  1. 1

    Add a YAML file

    Drop a .yaml or .yml file such as a workflow, manifest or spec.

  2. 2

    Choose JSON or XML

    JSON for tools and APIs; XML if a system needs it.

  3. 3

    Set indentation

    2 spaces matches most style guides.

  4. 4

    Convert and download

    Syntax errors are reported with the line and column.

Pro tips
  • ·Unexpected nesting in the JSON almost always means an indentation mistake in the YAML
  • ·Quote values like "no", "0755" or "1e3" in YAML when you mean them as strings
  • ·Remove secrets before sharing converted configs