YAML to JSON Converter

Data Conversion

Parse YAML — anchors, aliases, blocks and all — into JSON.

Runs entirely in your browser — nothing is uploaded

Features

  • Reads anchors, aliases and << merge keys, not just plain mappings.
  • Handles | and > block scalars with their chomping indicators.
  • Flow collections, comments and multiple --- documents.
  • Points at the exact line when a file will not parse.
  • Leaves yes / no as strings by default, following YAML 1.2.

How to use the YAML to JSON Converter

  1. 1Paste your YAML, or drop a .yaml or .yml file.
  2. 2Choose the indent and how to treat multiple documents.
  3. 3Copy the JSON or download it.

Frequently asked questions

Why does my file say “indented with a tab”?

YAML forbids tabs in indentation — it is the single most common reason a file that looks fine will not parse, because a tab and spaces are indistinguishable on screen. The error names the line so you can replace it with spaces.

Are anchors and aliases supported?

Yes. &name defines an anchor, *name refers back to it, and <<: merges a referenced mapping into the current one. All three are resolved, which is what makes a real docker-compose.yml with an x-defaults block convert properly.

Why is “no” a string rather than false?

YAML 1.2 treats only true and false as booleans; y/n/yes/no/on/off are a YAML 1.1 legacy that causes more harm than good. The default keeps them as strings so a country code of NO survives. Turn on the option if your file relies on the old behaviour.

What about a file with several --- documents?

Choose “First only” to convert the first document, or “All as array” to get every document as an entry in a JSON array — which is what a multi-resource Kubernetes manifest needs.

Which YAML features are not supported?

Explicit “? ” keys, non-string mapping keys and custom tags beyond the core !! set. Each of those is reported rather than silently mis-parsed, because returning quietly wrong data would be far worse than saying so.