katlab tools/yaml-json

YAML JSON Converter

Type or paste in either pane — the other side converts live. Clear error messages with line numbers when something doesn't parse.

Everything runs locally in your browser. Nothing is sent to a server.
YAML
JSON

How to convert YAML to JSON (or back)

  1. Paste YAML into the left pane — the JSON appears on the right instantly. Paste JSON on the right and the YAML appears on the left.
  2. Pick a JSON indent (2 spaces, 4 spaces, or minified).
  3. Use copy or download above either pane to take the result.

YAML is a superset of JSON

Every valid JSON document is already valid YAML 1.2 — you could feed JSON straight to most YAML parsers. The reverse is not true: YAML adds comments, anchors & aliases (&name / *name), multi-line block scalars (| and >), and unquoted strings. Converting YAML → JSON therefore resolves those features: comments are dropped, aliases are expanded into copies, and block scalars become ordinary strings with \n escapes.

Watch out for the Norway problem

In YAML 1.1, unquoted no, yes, on and off parse as booleans — so a country list containing NO (Norway) silently becomes false. This tool uses YAML 1.2 core schema rules (via js-yaml v4), where only true and false are booleans, which avoids the trap. If your target system runs an older YAML 1.1 parser, quote ambiguous strings anyway.

Multi-document YAML

A YAML stream can hold several documents separated by --- (a Kubernetes manifest file, for instance). This converter turns such a stream into a JSON array with one element per document. Converting that array back produces a single YAML document containing a list — JSON has no stream concept, so the round trip is intentionally one-way.

Is anything uploaded?

No. Parsing runs entirely in this page. Config files full of credentials never leave your machine — you can even use the tool offline once loaded.

Which library does the parsing?

js-yaml v4, the same parser used across the Node.js ecosystem, restricted to the YAML 1.2 core schema — no arbitrary type instantiation, no code execution, and date-like strings stay strings.