Converter

YAML to JSON Converter

Paste YAML on the left, get JSON on the right. The conversion is a real YAML 1.2 parse rather than a text rewrite, so nesting, lists and data types come across intact — and if the YAML has a syntax error, the exact line is reported instead of a broken output.

Works with .yaml, .yml and .json files — drag and drop one onto the input.

How to convert YAML to JSON

  1. 1. Get the YAML in

    Paste it from a config file, a Kubernetes manifest, a CI pipeline or an Ansible playbook — or drop the file itself onto the input box.

  2. 2. Read the JSON

    Output updates as you type, two-space indented. A syntax error stops the guesswork: you get the line and column that failed instead of a truncated document.

  3. 3. Copy or download

    Copy the result to your clipboard or save it as a .json file. Nothing is uploaded, so a file you would never paste into a random website is still safe here.

What changes on the way from YAML to JSON

YAML JSON Why
key: value"key": "value"JSON requires quoted keys and string values.
- one
- two
["one", "two"]A YAML sequence becomes an array.
nested:
  deep: true
{"nested": {"deep": true}}Indentation becomes braces; the tree is unchanged.
# a commentdroppedJSON has no comment syntax.
&anchor / *alias / <<:resolved inlineJSON has no references, so aliases expand into values.
date: 2026-08-11"date": "2026-08-11"Dates become strings; JSON has no date type.
--- (second document)first documentJSON holds one value per file, so multi-document input is converted one document at a time.

Why people convert at all

Feeding a JSON-only tool. Package manifests, REST payloads, most JavaScript configuration, and nearly every API expect JSON. YAML is the friendlier authoring format; JSON is what the machine consumes.

Checking that the YAML actually parses. A file that looks fine can fail on a single tab character or an unquoted colon. Converting is a fast way to prove the structure is valid, and the error message tells you where.

Reading a hostile config. Kubernetes and docker-compose files hide a lot in anchors and merge keys. In JSON the expanded result is visible, which makes it easier to see what a deployment really says.

Frequently asked questions

Does this convert YAML to JSON online for free?
Yes. Paste your YAML or drop a .yaml file, and the JSON appears next to it. No sign-up, no upload limit, no watermark on the output, and nothing is sent to a server.
Is my YAML data uploaded anywhere?
No. The conversion runs entirely in your browser with a JavaScript YAML parser. Once the page has loaded you can disconnect from the internet and it keeps working — which is also how you can verify the claim yourself.
What happens to YAML comments when I convert to JSON?
They are dropped, because JSON has no comment syntax. If a comment matters, keep it in the YAML file or move it into a key such as "_comment".
Can JSON be converted back to YAML?
Yes. Switch the direction with the swap button under the editor, or use the formatter on the home page. Values that would be misread as booleans or numbers in YAML are quoted automatically, so the round trip returns the same data.
Do anchors and aliases survive the conversion?
They are resolved rather than carried over, because JSON has no equivalent. A merge key such as "<<: *defaults" produces the merged values in the JSON output. Tick "Expand anchors" on the formatter to see the same resolution inside YAML.
Which YAML data types map to which JSON types?
Mappings become objects, sequences become arrays, and strings, numbers, booleans and null map one to one. Dates become ISO 8601 strings, because JSON has no date type.