Input
Ready
Lines: 0
Words: 0
Chars: 0
Size: 0 KB
Input statistics are available via the Stats button above this field.
Output
Lines: 0
Words: 0
Chars: 0
Size: 0 KB
Output statistics are available via the Stats button above this field.
Results are provided for informational purposes only and may contain errors. Please verify important information independently. Use of this tool is at your own risk.
What the JSON to YAML Converter does
The JSON to YAML Converter rewrites JSON as YAML: indentation replaces braces, list items start with a dash, and most strings no longer need quotes. The data is the same; only the notation changes.
Strings that could be misread in YAML, such as yes, null or text containing a colon, are quoted automatically so they stay strings.
Key order is kept, nested objects become indented blocks, and arrays of objects become lists whose items start with a dash. Empty arrays and objects are written as [] and {}.
When to use it
- Writing Kubernetes manifests, Docker Compose files, GitHub Actions workflows or Ansible playbooks from JSON you already have.
- Making a long configuration easier to read and review.
- Converting an OpenAPI specification from JSON to the more common YAML form.
- Preparing values for a Helm chart or another YAML-based configuration from a JSON export.
Worked example
Input
{"server": {"host": "localhost", "port": 8080}, "features": ["auth", "logging"], "debug": false}
Output
server:
host: localhost
port: 8080
features:
- auth
- logging
debug: false
Common questions about the JSON to YAML Converter
Is every JSON document valid YAML?
Yes. YAML 1.2 is a superset of JSON. Converting to block-style YAML makes it easier to read, but the data stays the same.
Can I add comments?
Yes, after converting. YAML supports comments that start with #. JSON has no comments, so the converter has none to carry over.
How do I go back to JSON?
Use the YAML to JSON Converter. Comments you added in YAML are dropped, because JSON cannot store them.