Code tool

YAML to JSON Converter

Turn a YAML configuration or data document into JSON while keeping the conversion limits visible and the source on your device.

In-browser processingNo account requiredPrivacy details ↗

Enter one non-empty YAML 1.2 document. Maximum 100,000 characters.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste one YAML 1.2 document up to 100,000 characters.
  2. Choose compact JSON or pretty output with two- or four-space indentation.
  3. Convert, review the JSON, then copy it or download a .json file.

A bounded YAML 1.2 conversion

The parser accepts one YAML 1.2 document and rejects duplicate mapping keys, multiple documents, unknown tags, cycles, and alias expansion beyond 50 references. Comments are accepted but do not exist in JSON output. Merge keys are treated as ordinary YAML 1.2 keys rather than automatically merging objects.

Only JSON-safe values reach the result

Mappings must use scalar keys that can become unique JSON object keys. Complex keys, NaN, and Infinity are rejected. Integers outside JavaScript’s safe range are emitted as JSON strings so their digits stay exact. The conversion runs locally and does not execute YAML content as code.

GOOD TO KNOW

Common questions

Can I convert a multi-document YAML stream?

No. Enter exactly one YAML document so the page can produce one unambiguous JSON root value.

Are anchors and aliases supported?

Ordinary aliases can be expanded up to the safety limit. Cycles and excessive expansion are rejected because JSON cannot represent them safely.

What happens to YAML comments?

They are discarded because JSON has no comment syntax.