Convertur

Convert YAML to JSON

Convert YAML to formatted JSON. Config files are parsed safely with js-yaml in your browser, anchors are resolved, and nothing is uploaded.

Loading tool...

Why convert YAML to JSON?

Many APIs and programs only accept JSON. Convert a YAML config to use it with those tools, to check it against a JSON schema, or to see exactly how a parser reads indentation and special values in a file that looks ambiguous.

How to convert YAML to JSON

Drop a .yaml or .yml file above and press Convert. js-yaml parses it with its safe schema, which never runs code or builds custom types, and the result is written as JSON with two-space indents. Download the .json file.

Compatibility

Anchors and aliases are resolved into plain values, and merge keys are expanded. Comments are dropped, because JSON has no comments. A file with several documents separated by --- lines is rejected, so split it first. If the YAML is broken, you get an error that points at the line with the problem.

Common uses

Developers convert Kubernetes manifests to JSON to use them with kubectl's JSON output tools or jq, turn OpenAPI specs written in YAML into the JSON some code generators need, and check GitHub Actions workflows by reading the parsed structure. The JSON also makes indentation mistakes obvious, because a misplaced key shows up at the wrong level.

Before you start

Input: YAML and YML. Output: JSON. The settings appear before anything runs, so you can check them first. Your original file is never changed.

A valid file can still hold the wrong data. Before you import the result, check the row count, field names, text encoding, dates, IDs and a few unusual rows.

Keep the original until you have opened and checked the result. The work happens in this browser tab, so the size you can handle depends on your device's memory, your browser and the file itself.

Steps to convert YAML to JSON

  1. Drop a .yaml or .yml file into the box above.
  2. Press Convert to parse it in your browser.
  3. Download the JSON.

Last updated · How we build and check tools · Report an error

Learn more

Related tools

YAML to JSON FAQ