Skip to main content

YAML to JSON Converter

Convert YAML to formatted JSON. Understands nested mappings, sequences, quoted scalars, block scalars and flow collections, and reports the line number when the YAML is invalid. Runs entirely in your browser.

Input

Drop a file or browse
One file · text
Or

Output

JSON output
 
Was this helpful?

Guides

Paste YAML, get formatted JSON. This free online YAML to JSON converter reads the YAML you actually meet in the wild — Kubernetes manifests, Docker Compose files, GitHub Actions workflows, OpenAPI specs, .gitlab-ci.yml, Ansible playbooks — and prints it as pretty JSON with two-space indentation. It runs as you type, with no upload and no sign-up.

How to use it

  1. Paste your YAML into the input box, or upload a .yml / .yaml file with the uploader — its contents drop straight into the editor.
  2. The JSON output appears instantly, syntax-highlighted.
  3. Copy it, or download it as a .json file.

If the YAML is malformed, you get an error naming the line, rather than a silently wrong result.

What YAML features are supported?

The converter handles the practical YAML 1.2 subset used by configuration files:

  • Block mappings and block sequences, nested by indentation — including a sequence indented level with its parent key.
  • Plain, single-quoted and double-quoted scalars, with \n, \t, \" and \uXXXX escapes.
  • Literal and folded block scalars: |, |-, |+, >, >-, >+.
  • Flow collections written JSON-style: [80, 443] and {cpu: 2, memory: 512}.
  • Comments, a leading ---, a closing ..., and empty values (which become null).

Anchors and aliases (&name / *name), merge keys (<<), explicit tags (!!str) and multiple documents in one input are reported as unsupported instead of being converted into something misleading.

How are types converted?

By YAML's core schema. true / false become JSON booleans; null and ~ become null; integers, floats, hex (0x1f) and octal (0o17) become numbers; everything else stays a string. Quoting a value — zip: "10001" — keeps it a string, which is exactly why config files quote zip codes, version numbers and port strings.

Why does my YAML fail to convert?

The usual causes are a tab character used for indentation (YAML forbids tabs), a missing space after a colon (key:value is one plain scalar, not a mapping), inconsistent indentation between sibling keys, or an unclosed quote. The error message points at the line.

Can I convert JSON back to YAML?

Yes — use the JSON to YAML converter. The two are inverses, so you can move a config between the formats in either direction.

Is my data private?

Completely. Parsing runs in your browser in pure JavaScript. Your YAML is never uploaded, never logged and never stored — safe for manifests containing internal hostnames, image tags or other details you'd rather not paste into a random website.

yamljsonconverterconfigdeveloper

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.