Text Tools: JSON Formatter JSON to XML Base64 URL Encoder JSON to CSV CSV to JSON CSS Gradient Regex Tester JWT Decoder Hash Generator UUID Generator Markdown to HTML Text Diff Checker Timestamp Converter YAML to JSON

YAML to JSON Converter

Convert YAML to JSON and JSON to YAML instantly | 100% Private

YAML & JSON Converter

Direction:

Both Directions

Convert YAML to JSON or JSON to YAML with a single click, then swap to round-trip.

Handles Real Configs

Nested mappings, lists of objects, flow collections, block scalars, and comments.

Clear Errors

Bad indentation or invalid syntax gets a specific message with the line number.

100% Private

Config files often hold secrets — yours never leave your browser.

YAML vs JSON: What's the Difference?

YAML and JSON describe exactly the same data model — objects, arrays, strings, numbers, booleans and null. The difference is entirely in the syntax and who it is optimised for. JSON is compact and unambiguous, which makes it ideal for APIs and machine-to-machine exchange. YAML uses indentation instead of braces and allows comments, which makes it far more pleasant to hand-edit — the reason Kubernetes, Docker Compose, GitHub Actions, and Ansible all use it.

Every JSON File Is Valid YAML

YAML is a superset of JSON, so any valid JSON document is already valid YAML. The reverse is not true: YAML features like comments, anchors, and block scalars have no JSON equivalent. Comments in particular are silently dropped when converting to JSON, since JSON has no comment syntax at all.

Common YAML Gotchas

Tabs are forbidden for indentation — YAML requires spaces, and mixing the two is the single most common parse error. Unquoted values like yes, no, on, and off are interpreted as booleans, which surprises people writing country codes like NO for Norway. Version numbers like 2.0 become the number 2, losing the trailing zero, so quote them if you need the exact string.

When to Convert

Converting YAML to JSON is useful when feeding a config into a tool or API that only accepts JSON, or when you want to validate structure quickly. Converting JSON to YAML is useful when turning an API response into a readable config file, or when you want to add comments explaining each field to your team.

Frequently Asked Questions

How do I convert YAML to JSON?

Paste your YAML into the input box with the YAML → JSON mode selected. The equivalent JSON appears instantly in the output box, ready to copy or download.

What is the difference between YAML and JSON?

Both represent the same kinds of data — objects, arrays, strings, numbers, booleans and null. JSON uses braces, brackets and quotes, making it compact and easy for machines to parse. YAML uses indentation and supports comments, making it easier for humans to read and edit, which is why it dominates configuration files.

Does this converter support comments and block scalars?

Yes. Comments starting with # are ignored during parsing, and block scalars using the | and > markers are converted into multi-line strings. Note that JSON has no comment syntax, so comments are dropped in the JSON output.

Is my data uploaded to a server?

No. Parsing and conversion run entirely in your browser using JavaScript. Your YAML or JSON is never transmitted, logged, or stored anywhere — which matters because config files often contain hostnames, keys, and other sensitive values.

What YAML features are not supported?

Anchors and aliases (& and *), multi-document streams, and custom type tags are not supported. The converter reports a clear error for these rather than producing a silently incorrect result.