Skip to content

YAML to JSON converter and validator

Convert YAML config files to JSON and back, or check a YAML file for syntax errors with the exact line number, without uploading your configuration anywhere.

  • Free, no limits
  • No sign-up
Everything happens in your browser; your data is never uploaded.
  • ✓ Free
  • ✓ No sign-up
  • ✓ Nothing uploaded

Next step

What to do next

How to use it

  1. Choose YAML to JSON, JSON to YAML, or Validate and format YAML.
  2. Paste your YAML or JSON.
  3. Fix any error at the line shown.
  4. Copy the result or swap it back into the input.
Try it now

What YAML is used for

YAML ("YAML Ain't Markup Language") is a human-friendly data format built on indentation. It is everywhere in DevOps and development:

  • Docker Compose files (compose.yaml),
  • Kubernetes manifests and Helm values,
  • CI/CD pipelines: GitHub Actions workflows, GitLab CI, CircleCI,
  • Ansible playbooks,
  • OpenAPI (Swagger) specifications,
  • front matter in Markdown files and static site generators.

JSON and YAML describe the same kinds of data: maps (objects), lists and scalar values. In fact, nearly every JSON document is also valid YAML. Converting between them is useful when one tool wants JSON and another wants YAML, or when you want to check exactly how a YAML file is interpreted.

Supported YAML features

FeatureExample
Key-value pairsname: my-app
Nested maps by indentationcompany: then city: Austin
Lists- pdf on separate lines
Inline lists and maps[a, b], {x: 1, y: 2}
Quoted strings"line\nbreak", 'single'
Multiline blocks| keeps line breaks, > folds them into spaces
Comments# ignored
Typesnumbers, true/false, null or ~

Not supported: anchors and aliases (&, *), custom tags (!), and multiple documents separated by --- in one file. Comments are lost on conversion because JSON has no comments.

Finding YAML errors

Validate and format YAML parses the file and shows the line number and a description of the first problem, then outputs a cleanly re-indented version. Typical errors:

  • Tabs used for indentation. YAML only allows spaces. Replace tabs with two spaces.
  • Inconsistent indentation between sibling keys, which makes YAML think a key belongs to a different parent.
  • A missing space after the colon: key:value is a plain string, not a pair.
  • Duplicate keys in the same map, which the tool reports instead of silently keeping the last one.
  • Unclosed quotes or brackets in inline values.

YAML gotchas

YAML guesses types for unquoted values, which sometimes surprises people:

  • version: 1.10 becomes the number 1.1. Quote it: version: "1.10".
  • zip: 02134 may lose its leading zero or be read as an octal number by some parsers. Quote ZIP codes and IDs.
  • In older YAML 1.1 parsers, yes, no, on and off become booleans, so the country code NO for Norway turned into false. YAML 1.2 fixed this, but quoting such values is the safe habit.
  • time: 12:30 can be read as a base-60 number by YAML 1.1 parsers.

Converting to JSON here is a quick way to see exactly what type each value ends up as.

Privacy and related tools

Configuration files often contain hostnames, internal URLs and sometimes secrets. Everything here is parsed and converted in your browser, and nothing is uploaded. Still, it is good practice to keep real secrets out of YAML files and use environment variables or a secret manager instead.

Related tools: format and validate JSON with the JSON formatter, or turn JSON into a spreadsheet with JSON to CSV.

Frequently asked questions

How do I convert YAML to JSON?

Paste the YAML with YAML to JSON selected. The JSON appears instantly with 2-space indentation.

Why does my YAML give an error?

The message shows the line number. The most common causes are tabs instead of spaces, uneven indentation and a missing space after a colon.

Are YAML anchors supported?

No. Anchors and aliases (& and *), tags (!) and multi-document files are not supported.

Are comments kept when converting?

No. JSON has no comments, so they are dropped. Formatting YAML also removes them.

Is my config uploaded?

No. Parsing and conversion happen in your browser.

Last updated: November 12, 2026

Recommended

Similar tools

If YAML to JSON converter helped, you may need these too.

See all in category →

People also use