Skip to main content

YAML to JSON Converter

YAML to JSON Converter takes a single YAML document that you paste and produces strict JSON representing the same data, entirely in your browser.

Converts supported YAML data to strict JSON locally in your browser. YAML 1.2 semantics are used, so true/false are booleans while yes/no/on/off stay strings and an unquoted date stays a string. JSON cannot represent every YAML feature: comments are not preserved, and unsupported YAML-specific types — custom tags, !!binary, !!timestamp, non-string mapping keys, integers too large for a JSON number, Infinity/NaN, and cyclic aliases — are rejected rather than silently changed. Acyclic anchors and aliases are expanded into duplicated values, and duplicate mapping keys are rejected. This is different from JSON to YAML, which converts the other direction, and from the JSON Formatter, which formats JSON.

Processed locally in your browser

How to use it

  1. Paste a single YAML document into the input box
  2. Choose the JSON indentation: 2 or 4 spaces, or compact
  3. Click Convert to JSON
  4. Review the JSON output and character counts, then copy the JSON

YAML 1.2 semantics are used: true and false are booleans, null and ~ are null, but yes, no, on, and off stay strings, and an unquoted date such as 2026-08-31 stays a string rather than becoming a date object. Mappings, sequences, and top-level primitives are all accepted. JSON cannot represent every YAML feature, so several things are rejected with a clear message rather than silently changed: multiple YAML documents in one input, duplicate mapping keys, non-string mapping keys (a bare 1: is refused to avoid a 1 versus "1" clash), custom tags, !!binary, !!timestamp, integers too large to be a safe JSON number, and Infinity or NaN. Acyclic anchors and aliases are expanded into duplicated values; a cyclic alias, or an alias-amplification attack, is stopped. Comments are not preserved, because JSON has no comments. You can choose 2- or 4-space indentation or compact output, and keys are not sorted. Nothing is uploaded or stored. This is different from JSON to YAML, which converts the other direction, and from the JSON Formatter, which only formats JSON.

FAQ

We use cookies to run this site and, with your consent, to understand usage and personalize ads. You can change your choice at any time.