YAML to JSON Converter

Paste YAML to get clean, indented JSON. The converter handles mappings, lists, nested structures, comments and the common scalar types — and runs entirely in your browser, so nothing is uploaded.

Paste some YAML above to see the JSON.

How YAML-to-JSON conversion works

YAML and JSON describe the same kinds of data — mappings (key/value), sequences (lists) and scalars (strings, numbers, booleans, null) — but YAML uses indentation and is easier for humans to read, while JSON uses braces and is what most APIs and config loaders expect. In fact, JSON is a subset of YAML, so every JSON document is already valid YAML.

YAML (indented) parse to data tree JSON.stringify

This converter parses your YAML's indentation into a nested data structure, then serializes it with JSON.stringify for clean, two-space-indented output you can paste straight into code.

Worked example

The YAML tags: followed by indented - free and - private becomes:

Mapping: name: Calcool"name": "Calcool".
List: the dashed items → a JSON array ["free", "private"].
Types: uploads: false → boolean, count: 117 → number, ratio: 1.5 → number.

Supported syntax

This is a focused, dependency-free parser that covers the YAML people write by hand: block mappings, block sequences, nesting by indentation, inline comments (#), quoted and unquoted scalars, and automatic typing of true/false, null and numbers. It intentionally leaves out advanced features like anchors, aliases, multi-document streams and complex multi-line block scalars, which need a full YAML library. For everyday config files it produces exactly the JSON you'd expect.

Tip: already have JSON to tidy up? Use the JSON formatter; converting tables instead? Try the CSV to JSON converter.

Frequently asked questions

Is JSON just a subset of YAML?

Yes. The YAML specification is a superset of JSON, so any valid JSON document is also valid YAML. That's why converting between them is mostly about changing the surface syntax, not the underlying data.

What YAML features aren't supported?

Advanced features like anchors and aliases (&/*), tagged types, multiple documents in one stream and complex multi-line block scalars need a full YAML library. This lightweight tool focuses on the hand-written config most people convert.

Are data types detected automatically?

Yes. Unquoted true/false become booleans, null/~ become null, and numeric values become numbers. Wrap a value in quotes if you want to force it to stay a string, for example a ZIP code or version string.

Is my YAML uploaded anywhere?

No. Parsing and JSON serialization happen entirely in your browser, so your configuration never leaves your device — safe for secrets-adjacent files like deployment configs.

MB
Mustafa Bilgic · Editor, Calcool
Implements a focused subset of YAML (block mappings, sequences, scalars, comments) and serializes with JSON.stringify. Everything runs in your browser — nothing you enter is uploaded, logged or stored.

Related calculators