YAML to JSON Converter (and Back)

Convert YAML to JSON and JSON to YAML in your browser. Handles the common subset — maps, lists, and scalars.

Supports the common YAML subset (maps, lists, scalars). Anchors, multi-line blocks, and flow collections are not handled.

About this tool

YAML and JSON describe the same kind of nested data, and config tools often accept one while you have the other. This converter translates between them in your browser. It parses the widely used YAML subset: indentation-based mappings, dash-prefixed sequences, and scalar values (strings, numbers, booleans, and null), and serializes JSON back into clean, indented YAML. Because YAML’s full specification is large, this tool deliberately targets the everyday subset that covers most config files (CI pipelines, Docker Compose, Kubernetes basics) rather than advanced features like anchors, aliases, multi-line block scalars, or flow collections — for those, a complete YAML library is recommended. Everything runs locally, so your configuration data stays private.

How to use it

  • Choose YAML → JSON or JSON → YAML.
  • Paste your document.
  • Click Convert.
  • Copy the result; review carefully for advanced YAML features.

Frequently asked questions

What is the relationship between YAML and JSON?
YAML is a superset of JSON conceptually — any JSON is valid YAML — but YAML adds human-friendly syntax like indentation instead of braces and comments. Both represent the same nested maps, lists, and scalar values.
What YAML features does this support?
The common subset: indentation-based mappings, "- " sequences, and scalar values (string, number, boolean, null). This covers most everyday config files. Anchors, aliases, multi-line block scalars, and flow style are not handled.
Why use YAML over JSON for config?
YAML is more readable for humans: no quotes or braces for most values, support for comments, and clean indentation. JSON is better for machine interchange and is universally parseable. Converting lets you work in whichever a tool requires.
How are data types inferred from YAML?
Unquoted true/false become booleans, ~ or null become null, numeric strings become numbers, and everything else is a string. Wrap a value in quotes to force it to stay a string (e.g. "123").
Why might my YAML not convert correctly?
If it uses advanced features — anchors (&/*), multi-line blocks (| or >), or inline flow syntax ({}/[]) — this subset parser may not handle them. Simplify the YAML or use a full library for those cases.
Is my config uploaded anywhere?
No. Both directions run entirely in your browser, so secrets and configuration data never leave your device.

Related tools