Developer

YAML to JSON Converter

Convert YAML to JSON and JSON to YAML live in a side-by-side editor. Handles anchors, merge keys and multi-document files, points at the exact line when something is wrong, and runs in your browser.

πŸ”’ 100% private. YAML and JSON stay in your browser β€” nothing is uploaded.

Converts as you type. Drop a .yaml, .yml or .json file on this box.

JSON output

            

What is this tool?

This YAML to JSON converter translates config files in both directions. Choose YAML β†’ JSON or JSON β†’ YAML, paste into the input pane or drop a file on it, and the output pane updates as you type. It uses the js-yaml parser with the YAML 1.2 JSON schema, so anchors and aliases, merge keys (<<), block scalars, flow collections and escape sequences all work, while values like no, yes and on stay strings. A file with several documents separated by --- becomes a JSON array. Options set the JSON indent (or minified), the YAML indent, sorted keys, inline style, and whether a top-level JSON array is written as separate YAML documents. Errors give the line and column and select the line in the input. Copy or download the result as .json or .yaml, and Swap converts it back to check a round trip. Nothing is uploaded.

How to Use

  1. Choose a direction: YAML β†’ JSON or JSON β†’ YAML.
  2. Paste your data into the input pane, press Open file, or drop a .yaml, .yml or .json file on it. Sample loads an example.
  3. Watch the output pane update as you type. Errors appear there in red with the line and column, and the line is selected in the input.
  4. Adjust the indent, sorting and multi-document options above the panes if needed.
  5. Press Copy or Download in the output pane, or Swap to convert the result back and check that it round-trips.

Frequently Asked Questions

Why does my YAML fail with a tab error?

YAML does not allow tabs for indentation, so the parser rejects them and names the line. Set your editor to insert spaces instead. Two spaces per level is the common convention.

Are anchors, merge keys and multiple documents supported?

Yes. Anchors (&name), aliases (*name) and merge keys (<<: *name) are resolved. Input with several documents separated by --- becomes a JSON array, one item per document. Custom tags such as !Ref are not supported and report an error.

Why did no or yes stay a string?

The converter follows YAML 1.2, where only true and false are booleans. Values like yes, no, on and off, and dates like 2026-01-15, stay strings. Numbers are still parsed, so 1.20 becomes 1.2; quote a value such as "1.20" to keep it as text.

Does it detect duplicate keys?

Yes. A mapping with the same key twice is reported as an error with its line number, because the second value would silently replace the first.

Other tools

There are more calculators, converters and editors on Wivrix. If something is missing, tell us.