YAML to JSON Converter

Convert YAML to JSON and JSON to YAML online. Validate YAML syntax and format output for APIs and config files.

About this calculator

Convert YAML to JSON or JSON to YAML, and validate the syntax on the way. YAML is popular for config files (Kubernetes, GitHub Actions, Docker Compose), while APIs speak JSON.

Indentation is meaningful in YAML, so a small slip changes the structure. The converter shows errors early.

How to use it

  1. Choose YAML → JSON or JSON → YAML.
  2. Paste your input.
  3. Press Convert and Copy Output.

Differences

YAML uses indentation and dashes: skills:\n - js\n - sql. JSON uses braces, brackets and quotes. YAML allows comments with #; JSON does not. Every JSON document is also valid YAML, but not the other way round.

Worked example

YAML name: Asha\nage: 30

JSON{"name": "Asha", "age": 30}

Tips and common mistakes

  • Use spaces, not tabs, in YAML.
  • Quote strings that look like numbers or booleans, such as "yes" or "0123".
  • Comments are lost in conversion to JSON.
  • Indentation of two spaces is the convention.
  • Validate before deploying a config.

Frequently asked questions

What is YAML?

A human-friendly data format used for configuration.

Is YAML a superset of JSON?

Yes, JSON is valid YAML.

Can YAML have comments?

Yes.

Why does YAML fail with tabs?

Tabs are not allowed for indentation.

What does the dash mean?

An item in a list.

Is conversion lossless?

Not for comments or anchors.

Related tools