Data Format Converters

YAML to JSON Converter

Paste YAML on the left and formatted JSON appears on the right. The parser handles the YAML that turns up in real configuration files — nested structures, lists, block scalars, comments — and tells you the line number when something will not parse.

  • Free, no sign-up
  • Runs in your browser
  • Nothing uploaded
  • Updated Sep 2026
Input
YAML input
JSON output
Waiting for input

At a glance

Direction
YAML → JSON (for the reverse, use the JSON to YAML converter)
Processing
Entirely client-side — nothing uploaded
Output
Pretty-printed or minified JSON
Handles
Mappings, sequences, block scalars, flow collections, comments
Not supported
Anchors, aliases, merge keys and multi-document streams
Cost
Free, no account, no rate limit

What this converter does

This tool parses YAML into a data structure and re-serialises that structure as JSON. Because YAML 1.2 is a superset of JSON, the conversion is mostly a matter of dropping the things JSON cannot express — comments, most importantly — and adding the punctuation JSON requires.

Most online converters fail unhelpfully: they report "invalid YAML" and leave you to find the problem. Indentation errors are the most common YAML mistake and the hardest to spot by eye, so this parser reports the line number and what it expected to find there. That is usually enough to locate a stray tab or a mis-aligned list item immediately.

Parsing happens in your browser. Nothing is transmitted, which matters because YAML files are where secrets, connection strings and deploy keys tend to live.

What YAML features are and are not supported

The parser covers the YAML that appears in configuration files, which is a deliberately smaller set than the full specification. Supported: nested mappings and sequences, plain and quoted scalars, inline flow collections like [a, b] and {k: v}, block scalars with | and > including the chomping indicators - and +, comments, and the standard scalar types (strings, integers, floats, booleans, null).

Not supported: anchors and aliases (&name and *name), merge keys (<<), explicit type tags (!!str), and multiple documents in a single stream. When the parser meets one of these it stops and says so with a line number, rather than producing output that looks right but silently drops data. That is the more useful failure: a converter that quietly discards an anchor gives you JSON you will trust and should not.

If your file uses anchors, expand them first — most YAML linters and IDE plugins will do this — and then convert.

Why YAML to JSON is the direction that can fail

Converting JSON to YAML always works. The other direction does not, and it is worth understanding why before you trust any converter's output.

JSON can only express four scalar types, plus objects and arrays. YAML can express comments, references between nodes, several documents in one file, and explicit type annotations, none of which have a JSON equivalent. Every converter therefore has to decide what to do with them, and the honest options are to fail loudly or to drop them. Comments are the one case where dropping is the right answer — everybody expects that — and this tool drops them silently. For anything else, it stops and tells you.

There is a second, subtler issue. YAML infers types from unquoted text, so version: 1.10 parses as the number 1.1, and a country code of NO can parse as the boolean false. These are properties of the YAML source, not of the conversion — but they become visible in the JSON, which is often the moment people discover the bug. If a value in the output has the wrong type, the fix belongs in the YAML: quote it.

How to use the YAML to JSON Converter

  1. Paste or upload your YAML

    Paste into the left pane or upload a .yaml or .yml file. Reading happens locally.

  2. Choose pretty or minified output

    Pretty-printed JSON is easier to read and review; minified is smaller for transmitting or embedding.

  3. Fix anything the status bar flags

    Errors name a line number. The usual culprits are a tab character used for indentation, which YAML forbids entirely, and a list item indented inconsistently with its siblings.

  4. Copy or download the JSON

    Copy it to the clipboard, or download it as a .json file.

Frequently asked questions

Is my YAML sent to a server?

No. Parsing runs in JavaScript inside your browser tab and there is no network request. You can confirm that in your browser's network panel.

Why does it say anchors are not supported?

Anchors and aliases let one part of a YAML file reference another. Resolving them correctly — including merge-key semantics — is genuinely intricate, and a converter that gets it subtly wrong produces JSON that looks plausible and is not. Rather than risk that, this tool stops and names the line. Expand the anchors in your editor first, then convert.

What happens to my comments?

They are dropped, because JSON has no comment syntax. There is no way to preserve them. If the comments matter, keep the YAML file as the source of truth and treat the JSON as generated output.

Why did my version number become a different value?

YAML infers types from unquoted text, so 1.10 is read as the float 1.1 and the trailing zero disappears. This happens in the YAML parser, not in the conversion. Quote the value in the source — version: "1.10" — and it stays a string.

Can I convert several YAML documents at once?

Not in one pass. A file with --- separators contains multiple documents, and JSON has no equivalent structure. Convert each document separately, or wrap them in a single top-level list first.

Does it validate my YAML against a schema?

No — it checks syntax, not meaning. A Kubernetes manifest with a misspelled field converts happily because the YAML is well-formed. For schema validation you need a tool that knows the specific schema, such as kubeval or a JSON Schema validator.