EN
My tools

YAML to JSON Converter

Convert YAML to JSON in your browser: anchors and merge keys expanded, multi-document files, dates kept or converted, and errors shown by line and column.

My tools →
Advertisement

YAML is pleasant to write by hand, but APIs, JavaScript code and many tools want JSON. This converter reads YAML with the js-yaml parser — anchors and aliases are expanded, merge keys (<<: *defaults) are applied, and files with several --- documents are supported — and writes standard JSON with the indentation you choose. Everything runs in your browser.

How to use this tool

  1. Paste your YAML (a Kubernetes manifest, a CI file, an OpenAPI spec…).
  2. Pick the JSON indentation, or Minified for a single line.
  3. Choose what happens with several documents: an array, the first one only, or one JSON per line.
  4. Decide whether dates stay as written or become ISO 8601 timestamps, then copy the JSON.

Formula

mapping → object · sequence → array · scalar → string, number, true/false or null

Plain scalars are typed by the YAML 1.2 core rules: true/false, null/~, integers (including 0x1F and 0o14) and floats. Words such as yes, no and on stay strings — they were booleans only in the old YAML 1.1. .inf and .nan become null because JSON cannot store them, and !!binary data becomes a Base64 string.

Example

The default sample defines defaults: &defaults with timeout 30 and retries 2, then production: <<: *defaults with timeout 60. In the JSON, production becomes {"timeout": 60, "retries": 2}: the merge copies both keys and the local timeout wins. enabled: yes stays the string "yes", and released: 2026-03-01 stays "2026-03-01" unless you choose ISO conversion, which gives "2026-03-01T00:00:00.000Z".

Frequently asked questions

Why did my error point to a different line?

The parser reports the place where the text stopped making sense, which can be just after the real mistake — for example the end of the file for a bracket that was never closed. Check the line above too.

Are comments kept?

No. JSON has no comments, so they are dropped. Key order is kept as written, except that keys which are whole numbers (such as 2) come first, as in any JavaScript object.

What happens to duplicate keys?

They are an error. The YAML specification requires unique keys, and silently keeping one value hides real mistakes.

How do I go the other way?

Use the JSON to YAML converter.

Sources

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). YAML to JSON Converter. https://kakao.mobile/tools/yaml-to-json-converter/

MLA

“YAML to JSON Converter.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/yaml-to-json-converter/.

Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms

Advertisement