YAML to JSON Converter

Paste YAML and get valid, formatted JSON โ€” with a plain-English error message and line number when something is wrong. Runs entirely in your browser.

How to convert YAML to JSON

  1. Paste your YAML on the left โ€” a Docker Compose file, a GitHub Actions workflow, a Kubernetes manifest, anything.
  2. Choose your indentation, or pick Minified for a single-line result.
  3. Press Convert to JSON. If the YAML has a problem you get the line number and what went wrong.

What this parser supports

Nested mappings and sequences, inline flow style such as [a, b] and {x: 1}, single- and double-quoted strings, literal and folded block scalars (| and > with - or + chomping), comments, and the usual scalar types โ€” integers, floats, booleans (true/false/yes/no/on/off), and nulls (null and ~). That covers the overwhelming majority of real configuration files.

What it deliberately does not support

Anchors and aliases (&name / *name), merge keys (<<:), explicit type tags (!!str) and complex mapping keys are rejected with a clear message rather than silently mis-parsed. Those features need a full YAML engine, and a converter that quietly guesses at them would hand you wrong JSON โ€” which is worse than an error. If you hit one, the message tells you which line to simplify.

Comments do not survive โ€” and that is not a bug

JSON has no comment syntax, so every # line in your YAML is dropped during conversion. If the comments matter, keep the YAML as the source of truth and treat the JSON as a build output. This is the single most common surprise when teams switch a config format, and the reason many projects keep YAML for humans and generate JSON for machines.

Why the conversion happens in your browser

Config files are full of things you should not paste into a stranger's server: API keys, database URLs, internal hostnames, secret names. This tool makes no network request โ€” the parser is JavaScript running on your own device. You can confirm that yourself by opening the network tab and converting a file.

Benefits

  • Handles the YAML that real config files use: nesting, sequences, flow style, quoted strings and block scalars.
  • Reports errors with the line number and a plain-English explanation instead of failing silently.
  • Outputs formatted or minified JSON with your choice of indentation.
  • Runs entirely in your browser, so secrets in a config file never leave your device.

Limitations to know

  • Anchors, aliases, merge keys and explicit type tags are rejected rather than guessed at.
  • Only the first document in a multi-document file is converted; the rest are reported and skipped.
  • Comments are dropped, because JSON has no way to express them.

Common mistakes to avoid

  • Mixing tabs and spaces for indentation โ€” YAML forbids tabs, so the parser converts them and the structure can shift.
  • Expecting comments to survive the conversion, then losing documentation that only existed in the YAML.
  • Leaving an unquoted value such as 08 or 1.10, which YAML reads as a number and reformats.

Alternatives

To convert in the other direction, use the JSON to YAML Converter. To pretty-print or validate the resulting JSON, use the JSON Formatter.

Last updated: August 2026 ยท Reviewed by the AI Toolbox editorial team.

Frequently asked questions

Which YAML version does it follow?

It follows the common YAML 1.1 conventions that Docker, Kubernetes and GitHub Actions use โ€” including treating yes and no as booleans when unquoted.

Why did my document fail on an anchor?

Anchors and aliases are reference features that need a full YAML engine. Rather than guess, the parser stops and tells you the line so you can expand the reference by hand.

Can it handle multiple documents in one file?

It converts the first document and tells you the rest were skipped. Split the file on the --- separators to convert the others.

Does it validate my YAML?

It reports structural errors such as bad indentation, a missing colon or an unclosed quote, with the line number. It does not validate against a schema.

Related tools