YAML to JSON Converter

Convert YAML to JSON online – config files, Kubernetes and Docker Compose files, with clear error messages that show the exact line and column.

Converter

Was this tool useful?

About this tool

About YAML to JSON Converter

Paste YAML and get clean, valid JSON instantly. The converter understands the full YAML 1.2 syntax – nested maps and lists, multi-line text (| and >), anchors and aliases, comments and several documents separated by ---. If the YAML has a mistake, you see the line, the column and a pointer to the problem, so wrong indentation is easy to fix.

How it works

YAML is parsed with js-yaml (YAML 1.2 core schema) and written with JSON.stringify. Dates stay as text; values JSON cannot hold (such as .inf) become strings.

Example

“port: 8080” and “tls: true” become "port": 8080 and "tls": true – numbers and true/false keep their type.

How to use this tool

  1. Paste your YAML (or press the sample).
  2. Choose the indent and how several documents are handled.
  3. Copy or download the JSON.

Frequently asked questions

Why does my YAML give an indentation error?

YAML uses spaces (never tabs) to show nesting, and items at the same level must line up exactly. The error message points to the first line that does not line up.

What happens with several documents?

A file with --- separators holds several documents. Tick “Several documents → one array” to get them all; otherwise only the first is converted.

Does the YAML to JSON Converter send my data to a server?

No. The YAML to JSON Converter runs entirely in your browser using JavaScript, so tokens, code and data you paste stay on your device. You can even use it offline once the page has loaded.