1. Home
  2. Tools
  3. YAML → JSON Converter

YAML to JSON converter with line-accurate error reporting

YAML is forgiving to write and unforgiving to debug. This converter parses your document, resolves anchors and aliases, and hands back JSON that you can paste straight into a JavaScript config or an HTTP request body.

YAML dialects
YAML 1.2 core
Documents
Multi-doc supported
Uploads
None
YAML → JSON Converter YAML 1.2 core schema, anchors and aliases resolved

How to use it

  1. Paste your YAML The source pane accepts block style, flow style and documents separated by --- markers.
  2. Convert The converter emits the JSON equivalent with two-space indentation. Anchors and merge keys are resolved into their expanded values.
  3. Fix anything it flags When the document cannot be parsed, the error names the line and column and shows the offending line so you can correct it without counting characters.

Reference

Common YAML shapes and the JSON they produce

YAMLJSON
`name: devsnap``{"name": "devsnap"}`
`ports: [80, 443]``{"ports": [80, 443]}`
`on: push: branches: [main]``{"on": {"push": {"branches": ["main"]}}}`
`base: &b retries: 3``{"base": {"retries": 3}}`

Questions people ask

Can I convert JSON back to YAML as well?

The converter handles YAML in, JSON out. If you need the reverse direction, the JSON formatter gives you the same parsed structure and you can serialise it with whichever YAML library your project already uses.

Does it support YAML anchors and aliases?

Yes. An anchor defined with & and referenced with an alias or a merge key with << are expanded into the output, matching the behaviour of a standard YAML loader at runtime.

What is the difference between YAML 1.1 and YAML 1.2?

YAML 1.1 has legacy type coercions — `yes`, `no`, `on` and `off` become booleans and sexagesimal numbers are allowed. YAML 1.2 narrows those to `true` and `false`. The converter uses 1.2 because that is what Kubernetes, GitHub Actions and most current libraries implement.

Why does my Kubernetes manifest fail to parse?

Usually one of three things: a tab used for indentation, a `---` document separator that leaves trailing content, or a value that contains a colon followed by a space without being quoted.

How do I convert a multi-document YAML file?

Paste the whole file. Documents separated by --- are parsed independently and each one is emitted as its own JSON object, in order.

Is there a size limit?

No explicit limit. Very large documents are limited by the memory available to the browser tab, which is generous for the configuration-sized files this tool is built for.

Details that catch people out

Indentation is the whole language

YAML uses spaces for structure, and a tab character is a hard error rather than a warning. If a document fails at an unexpected line, look for a tab that snuck in from an editor, and for a child key that is indented less than its parent.

The Norway problem

YAML 1.1 treats the bare tokens `no`, `yes`, `on` and `off` as booleans, so a country code of `NO` becomes `false` in a 1.1 parser. This converter follows YAML 1.2, where only `true` and `false` are booleans, which is what Kubernetes and most modern tooling expects.

A converter that does not keep a copy of your config

Configuration files are the most sensitive files a developer owns. They routinely contain registry credentials, database URLs and internal hostnames. Sending one to a conversion API means adding another party to that list, which is why this one converts in the tab.

  • Your file is parsed locally and never transmitted.
  • YAML 1.2 semantics, so `NO` stays a string.
  • Anchors, aliases and merge keys are resolved the way your runtime resolves them.
  • Multiple documents separated by --- are converted one after another.

Last reviewed 2026-10-08. Every tool on DevSnap runs entirely in your browser, so whatever you paste here never reaches a server.