Skip to content
toolsdocks

Convert YAML to JSON

Paste YAML or open a .yaml file and get JSON as you type. This page opens the YAML and XML tool with YAML selected and the To JSON action on.

Runs on your device

More options in the full YAML and XML formatter and validator.

Loading tool…

How to convert YAML to JSON

  1. Paste the YAML or open a .yaml or .yml file.
  2. Keep Language on YAML and Action on To JSON.
  3. Fix any error at the line and column shown.
  4. Copy the JSON or download converted.json.

Worked example

The YAML service: with port: 8080 and hosts: [a.example, b.example] indented under it becomes {"service":{"port":8080,"hosts":["a.example","b.example"]}}, and answer: yes stays the text "yes".

Formats and limits

InputYAML
OutputJSON
Enginejs-yaml (YAML 1.2) and fast-xml-parser with validator

Limitations

  • .inf and .nan have no JSON equivalent and become null, with a warning.
  • Comments are dropped.
  • Files up to 50 MB.

Questions

Is yes turned into true?

No. YAML 1.2 rules are used, so yes, no, on and off stay text; only true and false become booleans.

What happens to comments and anchors?

JSON has no comments, so they are dropped. Anchors, aliases and << merge keys are resolved into plain values.

Is my YAML uploaded?

No. It is parsed and converted in your browser.

Privacy

Runs on your device. Files and text are processed in this browser tab and are not uploaded.

This page opens the YAML and XML formatter and validator ready for this task. See the privacy policy for how toolsdocks handles data.