YAML to JSON and JSON to YAML Converter
Convert YAML to JSON or JSON to YAML instantly. Anchors, aliases, merge keys and multiple documents are supported.
Loading tool…
How to use the YAML JSON Converter
- Choose YAML to JSON or JSON to YAML.
- Paste your data into the input box.
- Pick the indent size (and, for JSON arrays, whether to write several YAML documents) and read the output.
- Copy it or download it as a file.
About this tool
YAML and JSON describe the same kinds of data: maps, lists and scalar values. YAML uses indentation and is popular for configuration files such as Docker Compose, Kubernetes manifests, GitHub Actions and OpenAPI specs, while JSON is the common format for APIs. This tool uses its own YAML parser, so it works offline and never uploads your file.
Supported YAML: nested maps and lists, comments, plain and quoted strings, numbers, booleans, null, inline lists and maps, multi-line strings (| and >), anchors and aliases (&base and *base), merge keys (<<: *base, or a list of aliases, where explicit keys win), the core tags !!str, !!int, !!float, !!bool and !!null, and multiple documents separated by ---, which become a JSON array. Not supported: custom tags (!name, !!binary, !!timestamp), complex keys (?) and anchors on a key. These give an explicit error with a line number instead of a wrong result.
This follows YAML 1.2, so yes, no, on and off stay text (YAML 1.1 tools read them as booleans), and dates such as 2026-01-31 stay text. When writing YAML from JSON, such words and number-like strings are quoted so they round trip. Tabs for indentation are rejected, as the YAML spec requires. YAML comments cannot exist in JSON, so they are dropped, and anchors are expanded into copies. This is a hand-written parser covering the YAML used in real configs, not the full specification.
Frequently asked questions
Which YAML features are not supported?
Custom tags, complex keys (?) and anchors on keys. Anchors, aliases, merge keys and multi-document files are supported.
Why did my string turn into a number or boolean?
Unquoted values like 123, true or null are parsed by YAML rules. Put quotes around them to keep them as text. yes and no stay text in YAML 1.2.
Are comments kept when converting to JSON?
No. JSON has no comments, so they are dropped.
How are multiple documents handled?
Documents separated by --- become a JSON array. In the other direction, tick the option to write a top-level array as separate documents.
Is my data sent anywhere?
No. Conversion runs in your browser.
Need a custom tool or website?
IDM Valley builds web apps, calculators, AI chatbots and automation for businesses. Fixed prices, code in your name.









