Skip to main content
Back to tools

YAML to JSON

Convert between YAML and JSON formats

About YAML to JSON

YAML to JSON lets you convert between yaml and json formats.

Category: Encoding.

Frequently asked questions

What's the main difference between YAML and JSON?

YAML uses indentation instead of braces and brackets, supports comments, and is more human-readable. JSON is stricter, has no comments, and is better for machine interchange and API payloads.

Does YAML support comments?

Yes. Lines starting with # are comments. Note that converting YAML to JSON discards all comments, since JSON has no comment syntax.

What are common YAML pitfalls?

Tabs instead of spaces (YAML requires spaces), bare strings that look like booleans (yes, no, true, false become boolean values), and implicit type coercion of numbers without quotes.

Is YAML a superset of JSON?

Yes, valid JSON is also valid YAML 1.2. This means you can paste JSON into a YAML parser without changes.

Related tools