Skip to content

Free tool

YAML ⇄ JSON Converter

Convert docker-compose, Kubernetes and CI snippets between YAML and JSON. Errors name the line, and nothing leaves your browser.

Runs entirely in your browser. Nothing you enter is sent to a server.

How it works

YAML describes structure with indentation, while JSON uses braces and brackets. This converter parses the YAML subset used in everyday infrastructure files into plain data (objects, arrays, strings, numbers, booleans and null) and writes it out as JSON, or does the reverse using the standard JSON parser and a small YAML writer.

It deliberately refuses what it cannot read faithfully: tabs for indentation, duplicate keys, anchors and aliases, tags, and multiple documents. That way you get a clear message with a line number instead of a silently wrong result. Comments are lost in conversion because JSON cannot hold them.

Common uses

  • Turning a docker-compose.yml or Kubernetes manifest into JSON for an API call or a script.
  • Writing a JSON policy or config and converting it to YAML for a CI or Helm values file.
  • Spotting indentation mistakes: a YAML file that will not convert usually will not deploy either.
  • Quickly checking what type a YAML value really has once it is parsed.

Frequently asked questions

Which parts of YAML does this converter support?

The common subset used in docker-compose files, Kubernetes manifests and CI configuration: nested mappings and lists, plain and quoted strings, numbers, booleans, null, comments, inline [lists] and {maps}, and literal (|) and folded (>) multi-line blocks with - and + chomping. Anchors, aliases, tags, merge keys and multi-document files are reported as errors rather than guessed at.

What happens to comments when converting YAML to JSON?

JSON has no comments, so they are dropped. Converting back to YAML therefore cannot restore them. Keep your original YAML if the comments matter.

Why did my value become a string, number or boolean?

Plain YAML scalars are typed by their shape: true and false become booleans, null and ~ become null, and digits become numbers. Numbers with a leading zero, such as 0755, are kept as strings. Quote a value, like "3.10" or "true", to keep it a string. The YAML 1.1 words yes, no, on and off stay strings here, and the JSON to YAML direction quotes them so other parsers read them back as strings.

How do I convert several Kubernetes documents separated by ---?

Convert one document at a time. Files that contain several documents separated by --- are not supported, so paste each document separately.

Is my configuration uploaded anywhere?

No. Parsing and conversion run in your browser. Even so, avoid pasting real passwords, tokens or private keys into any online tool.

All free tools

Need something built?

Need help with your cloud or software?

These tools are free to use. If you need cloud and DevOps, web or mobile development, CRM integrations or managed IT support, tell us what you are working on.