# YAML to JSON

> Convert YAML to JSON online: numbers kept as written, anchors and merge keys expanded, yes and no kept as strings unless you choose YAML 1.1 booleans.

- URL: https://jsonstatham.dev/yaml-to-json/
- Language: English (en)
- Russian version: https://jsonstatham.dev/ru/yaml-to-json.md
- Updated: 2026-11-20

Paste YAML to get JSON with the values YAML 1.2 actually means: numbers kept as written, anchors and merge keys expanded, and yes or no left as strings unless you ask for YAML 1.1. The conversion runs on our API; the text is never logged or stored.

## How to convert YAML to JSON

1. Paste YAML, open a .yaml file or drop one on the input.
2. Pick the indent; tick YAML 1.1 booleans or All documents if your file needs them.
3. Copy or download the JSON. The facts under it count every alias, boolean and number that changed form.

## YAML 1.1 vs 1.2: no, on and 0x1F

YAML 1.1 readers such as PyYAML read no and on as booleans; YAML 1.2 reads them as strings. Here they stay strings by default, and the facts count them. Hex and octal numbers become decimals, 2.50 keeps its zero, a key repeated as 1 and "1" is an error, and tags with no JSON form, such as binary data or CloudFormation’s Ref, stop the conversion instead of vanishing.

## YAML to JSON converter FAQ

### Why is no a string and not false?

In YAML 1.2, the current version, only true and false are booleans. YAML 1.1 also read yes, no, on and off as booleans — the “Norway problem”. Tick YAML 1.1 booleans to read them the old way.

### What happens to anchors, aliases and merge keys?

Each alias is replaced by a copy of its anchor, and merge keys (<<) are expanded in place, with the mapping’s own keys winning. The result is plain JSON without references; the facts say how many aliases were expanded.

### Can it convert a file with several documents?

Yes: tick All documents, and the stream becomes a JSON array with one element per document. Without it, the second --- is an error, so nothing is dropped silently.

### Is my YAML stored?

No. It goes to our API over HTTPS, is converted in memory and is never logged or stored. Usage statistics are tied to a random device ID and never include your YAML.

## Other tools

- [JSON Formatter](https://jsonstatham.dev/) — 2 spaces, 4 spaces or tabs, order kept.
- [JSON Validator](https://jsonstatham.dev/validator/) — exact line and column for every error.
- [JSON Diff](https://jsonstatham.dev/diff/) — what changed, with JSON Pointer paths.
- [JSON Viewer](https://jsonstatham.dev/viewer/) — a tree with search and a path for every node.
- [Base64 Encode & Decode](https://jsonstatham.dev/base64/) — in your browser, nothing sent.
- [JWT Decoder](https://jsonstatham.dev/jwt/) — header, payload and expiry, decoded in your browser.
- [JSON to Query String](https://jsonstatham.dev/json-to-query/) — arrays, nesting and spaces your way, and back.
- [Unicode Unescape](https://jsonstatham.dev/unicode-unescape/) — \u0430 from DevTools into letters, in your browser.
- [JSON Minifier](https://jsonstatham.dev/minifier/) — one line, every byte accounted for.
- [JSON to YAML](https://jsonstatham.dev/json-to-yaml/) — same order, same numbers, safe quoting.
- [JSON Position Finder](https://jsonstatham.dev/json-position/) — turn “position 1234” into a line and column.
