YAML ↔ JSON

Convert between YAML and JSON with live validation.

Valid YAML
{
  "name": "devtools-portal",
  "version": "1.0.0",
  "features": [
    "json",
    "yaml",
    "regex"
  ],
  "servers": [
    {
      "host": "api.example.com",
      "port": 443,
      "secure": true
    }
  ]
}

About YAML ↔ JSON

YAML ↔ JSON converts in either direction with live validation. Paste YAML and get the equivalent JSON; paste JSON and get YAML — the tool detects which side you typed in and parses accordingly. Both directions preserve types: YAML strings, numbers, booleans, nulls, arrays, and objects map to their JSON counterparts; YAML's anchors and aliases are resolved on the way to JSON.

Reach for it whenever a config file is in the wrong format for the next consumer: a Kubernetes manifest in YAML that you want to inspect with JSON tools, an Ansible playbook you want to transform programmatically, a JSON Schema you want to read in YAML, a `docker-compose.yml` you want to feed into a JSON-only validator, or a CI workflow that you want to diff against a JSON snapshot. Both formats describe the same data shape; this tool is the bridge. CSV ↔ JSON is the equivalent for tabular data; XML ↔ JSON is the equivalent for SOAP / RSS / SVG.

Examples

Input
name: Ada
born: 1815
tags:
  - mathematician
  - programmer
Output
{
  "name": "Ada",
  "born": 1815,
  "tags": ["mathematician", "programmer"]
}

YAML → JSON. The tool detects YAML automatically; pasting JSON in the same box produces YAML.

Frequently asked questions

Does YAML → JSON ever lose information?

Anchors and aliases are resolved (the YAML `&anchor` references are inlined into the JSON), and YAML-specific types like timestamps without a JSON equivalent are emitted as ISO-8601 strings. Comments, which YAML supports and JSON does not, are dropped — JSON has no syntax for them.

Which YAML version is supported?

YAML 1.2 — the version every modern parser implements. Most YAML 1.1 documents parse identically; the few divergences (`yes`/`no` as booleans in 1.1, octal-without-prefix in 1.1) are documented at the parser's project page.

How is this different from XML ↔ JSON?

Different format pair. YAML and JSON describe the same data shape and convert losslessly; XML and JSON have a small representation gap around mixed content and attributes. Both are useful — pick the converter that matches your inputs.

Does it run schema validation?

Only well-formedness is checked: that the YAML parses and produces valid JSON. For schema validation against an OpenAPI, JSON Schema, or Kubernetes CRD spec, run the JSON output through JSON Schema Validator afterwards.