↑

Free YAML to JSON Converter

What this tool does

The YAML to JSON Converter turns YAML into clean, formatted JSON, or converts JSON back to YAML, right in your browser. Paste your document and the result appears instantly, with nested objects, lists, numbers, booleans, quoted strings and flow-style values all handled. Line counts and the root type are shown, errors point to the problem line, and you can copy or download the converted file. Free and private.


YAML input
Supports nested objects, lists, numbers, booleans, null, quoted strings, flow style [1, 2] and comments. YAML must use spaces for indentation, never tabs.
-
Input lines
-
Output lines
-
Root type
JSON output

Let us know

Please share your experience with this tool.

Thanks for rating!
No ratings yet — be the first!

How do I use the YAML to JSON converter?

Paste your YAML into the left box and the JSON appears on the right as you type, formatted with two-space indentation. Switch the Direction menu to convert JSON back into YAML instead. The counters show input and output lines plus the root type (Object, Array or a scalar), and if something is wrong the message points at the problem, for example a tab used for indentation. Press Sample to load a document with nested objects, a list of maps, flow-style tags and a quoted value containing a colon, then use Copy result or Download to take the output away.

What is YAML?

YAML (YAML Ain't Markup Language) is a human-friendly data format used for configuration files in tools like Docker Compose, Kubernetes, GitHub Actions and many app frameworks. It uses indentation instead of braces to show structure, dashes for lists and "key: value" pairs for mappings, which makes it easy to read and edit by hand. It also supports comments, which JSON does not. The trade-off is that indentation mistakes are the most common source of errors, and tabs are forbidden.

YAML vs JSON: what is the difference?

Both describe the same kinds of data: objects, arrays, strings, numbers, booleans and null. JSON uses braces, brackets and quoted keys, which machines parse strictly and quickly, making it the standard for APIs. YAML drops most punctuation and relies on indentation, which people find easier to write and review, making it the standard for configuration. Because the data model matches, converting between them is lossless for ordinary documents, except that YAML comments have nowhere to go in JSON and are dropped.

What does the converter support?

Nested mappings at any depth, lists (including lists of objects), plain and quoted strings, integers, decimals and scientific notation, true/false booleans, null and empty values, flow-style collections such as [1, 2] and {x: 1, y: 2}, and comments anywhere in the document. In JSON to YAML mode it writes clean block-style YAML and quotes strings automatically when they would otherwise be misread, for example a value containing a colon. Document markers (--- and ...) are accepted and ignored.

What are the most common YAML mistakes?

Using tabs for indentation is the classic one; YAML requires spaces, and this converter flags the exact line. Inconsistent indentation is next: children of the same parent must line up exactly. Unquoted values containing ": " (a colon followed by a space) also break parsing, so wrap values like "use: with care" in quotes. Finally, remember that unquoted yes/no/on/off and numbers with leading zeros can be read differently by different parsers; quote anything that must stay a string.

Is it free and private?

Yes. The YAML to JSON converter is completely free, needs no sign-up, and runs entirely in your browser. Your documents are never uploaded to a server, which matters when configs contain internal hostnames or settings. It works on phones, tablets and desktop computers.

FAQs

How do I convert YAML to JSON?

Paste your YAML into the input box and the formatted JSON appears instantly on the right. Use Copy result or Download to save it as a .json file.

Can it convert JSON back to YAML?

Yes. Switch the Direction menu to "JSON to YAML", paste your JSON, and clean block-style YAML is produced, with quotes added automatically where a value needs them.

Does it support nested objects and lists?

Yes, at any depth, including lists of objects and flow-style values like [1, 2] and {x: 1, y: 2}. Press Sample to see a nested example.

Why does my YAML fail to convert?

The usual causes are tabs used for indentation (YAML requires spaces), children that do not line up, or an unquoted value containing ": ". The error message names the problem line.

Are YAML comments preserved?

Comments are accepted in the input but cannot appear in JSON, because JSON has no comment syntax, so they are dropped during conversion.

Is it free?

Yes, completely free with no sign-up. Everything runs in your browser, so your documents stay private.


Author

Awais Arshad

Web Tools Developer & Content Creator at FastToolKit.