JSON to YAML Converter
Convert JSON to YAML: get clean, readable YAML for configuration files.
JSON input
YAML output
How to convert JSON to YAML
- Paste JSON on the left, or open or drop a .json file.
- The YAML appears on the right as you type.
- Choose 2- or 4-space indentation and whether every string should be quoted.
- Copy the YAML or download it as a .yaml file.
Readable YAML from JSON
YAML says the same thing as JSON with less punctuation, which is why config files, Kubernetes manifests and CI pipelines use it. The converter keeps your key order and data types and quotes only the strings that would otherwise be misread — like "yes", "1.0" or "off".
{"name": "web", "replicas": 3, "ports": [80, 443], "debug": false}name: web
replicas: 3
ports:
- 80
- 443
debug: falseUse cases
- Turn a JSON config into a YAML one for Kubernetes, Docker Compose or Helm.
- Convert an OpenAPI or Swagger spec from JSON to YAML.
- Make JSON data easier to read and comment in code reviews.
When values are quoted in YAML
YAML guesses types from unquoted text, so some JSON strings have to be quoted to keep their meaning. The converter adds quotes only where they are needed:
{"on":"yes","version":"1.10","empty":null,"list":[],"text":"line1\nline2"}"on": "yes"
version: "1.10"
empty: null
list: []
text: |-
line1
line2on and yes mean true in older YAML parsers, and 1.10 unquoted would become the number 1.1. Multi-line strings are written as readable block scalars.
Related JSON and YAML tools
Convert back with YAML to JSON. Check your JSON first with the JSON validator, then tidy the resulting YAML with the YAML formatter or check it with the YAML validator. Need XML instead? Use JSON to XML.
Frequently asked questions
- Why are some strings quoted in the YAML?
- Values like "yes", "on", "1.0" or "010" would be read as booleans or numbers by many YAML parsers. The converter quotes them so they stay strings everywhere.
- Is the converted YAML valid for Kubernetes and Docker Compose?
- Yes. The output is standard YAML with 2-space indentation, which those tools accept. Converting keeps key order, so manifests stay readable.
- Can I convert YAML back to JSON?
- Yes, with the YAML to JSON converter. Converting JSON to YAML and back gives the same data.
- Are large numbers preserved?
- Yes. Integers beyond JavaScript's safe range (like 64-bit IDs) are written exactly, without rounding.
- Will the YAML keep my key order and data types?
- Yes. Keys stay in the order of the JSON, numbers and booleans stay unquoted, and strings that YAML would misread — such as "yes", "on" or "1.10" — are quoted so they stay strings when the YAML is read back.