Convert YAML to JSON

Paste a config file, a Kubernetes manifest, an OpenAPI spec or a GitHub Actions workflow and get JSON. If the YAML is broken, you see the line and column where parsing failed.

  • Free
  • Runs in your browser
  • Errors with line numbers
  • No sign-up
How it works

How It Works

Convert YAML in three steps.

01

Paste YAML

One document, or several separated by ---.

02

Check the JSON

Indented with 2 or 4 spaces, or minified.

03

Copy or download

Copy the JSON or save it as converted.json.

About

YAML and JSON: same data, different syntax

YAML is designed for people to write: indentation instead of braces, no quotes around most strings, comments. JSON is what most APIs and programs read. Every JSON document is valid YAML, but YAML has extras that need resolving when converting, such as anchors (&) and aliases (*) that reuse a block, and several documents in one file. The converter uses the yaml library with YAML 1.2 rules.

Comments are dropped, because JSON has no comments. Under YAML 1.2, values like yes, no and on stay strings; only true and false become booleans.

Error position

Indentation mistakes and stray characters are reported with their line and column.

Anchors and merge keys

&anchor, *alias and <<: merge keys are expanded, so the JSON contains the full values.

Multiple documents

A file with several --- documents becomes a JSON array, one item per document.

Alias limit

Documents that expand aliases into millions of values ("billion laughs") are refused instead of freezing the tab.

Features

Why Use This Converter

Configs to JSON without a script.

Find the mistake

A line and column are faster than staring at indentation.

Multi-document files

Kubernetes manifests with several resources convert in one go.

Secrets stay local

Config files often hold keys and passwords; they are converted in your browser.

Save as a file

Download the result as converted.json.

✓ No Registration✓ Free✓ Browser-based✓ Text Stays Local
FAQ

Frequently Asked Questions

Questions people ask about the YAML to JSON converter.

This converter follows YAML 1.2, the current version, where only true and false are booleans. Older YAML 1.1 parsers such as PyYAML treat yes, no, on and off as booleans too.