← All tools
// Data / Developer

YAML to JSON online

Convert YAML configuration files to JSON — browser-side

YAML to JSON Converter logo
by
CHUNKY
MUNSTER
// YAML input

How to Use yaml-to-json

  1. Paste YAML configuration or data into the input area.
  2. The equivalent JSON appears in the output panel instantly.
  3. Toggle pretty-print or compact output.
  4. Copy the JSON or download it as a .json file.

YAML (YAML Ain't Markup Language) is the human-friendly configuration format used in Kubernetes, Docker Compose, GitHub Actions, Ansible, and most CI/CD systems. JSON is the machine-friendly API exchange format. Converting between them is a constant need — especially when debugging a YAML config by examining its parsed structure, or when an API requires JSON but your workflow generates YAML.

YAML vs JSON: Key Differences

YAML is a superset of JSON — every valid JSON document is valid YAML. YAML adds: comments (#), human-readable block sequences and mappings (no braces or brackets required), multi-line strings, and anchors/aliases for DRY configuration (&anchor / *alias). JSON is stricter: no comments, no trailing commas, double-quoted strings only. When converting YAML to JSON, comments are discarded and anchor/alias references are resolved.

Frequently Asked Questions

Can I convert YAML with anchors and aliases?

Yes. Anchors (&name) mark a node for reuse; aliases (*name) reference it. When converting to JSON, all aliases are replaced with the referenced content inline — JSON has no equivalent shorthand.

Why does "yes" in YAML become true in JSON?

YAML 1.1 treated "yes", "no", "on", "off", "true", "false" as Booleans. YAML 1.2 restricted this to only "true" and "false". Many YAML parsers still use 1.1 semantics. If your YAML has "yes" as a string value, quote it explicitly: "yes".

How are multi-line YAML strings converted?

Literal block scalars (|) preserve newlines as-is. Folded scalars (>) join lines with a single space (replacing the newline). Both become JSON string values with appropriate newline characters in the output.

Does YAML support all JSON data types?

Yes — YAML strings, numbers, booleans, null, sequences (arrays), and mappings (objects) all map directly to JSON equivalents. YAML also supports ordered maps and binary data types that have no JSON equivalent and are handled as strings in the output.

See also JSON to YAML, YAML to CSV, YAML to XML, and the JSON Formatter.