The JSON to YAML Converter transforms any valid JSON into clean, readable YAML. Strings are unquoted where safe and quoted only when necessary. Multi-line strings use YAML block scalar format. Numbers, booleans, and nulls map directly to their YAML equivalents. The output is immediately usable in Kubernetes manifests, Docker Compose files, GitHub Actions workflows, and any other YAML-based config format.
1. Paste JSON into the input box, upload a .json file, or click Sample to try a Kubernetes deployment example.
2. YAML output is generated automatically as you type.
3. Choose 2-space or 4-space indentation — 2 spaces is the Kubernetes and GitHub Actions convention.
4. Click Download YAML to save as a .yaml file, or Copy Output to paste it elsewhere.
What JSON structures does this tool support?
Any valid JSON — objects, arrays, nested structures, strings, numbers, booleans, and nulls. The tool uses the browser's built-in JSON.parse(), so if your JSON is valid it will convert.
How are JSON types mapped to YAML?
Strings are output unquoted where safe, or with double-quotes when they contain special characters or would be misread as another type. Numbers and booleans map directly. Null becomes the YAML null literal. Arrays become YAML sequences with "- " prefix. Objects become YAML mappings.
When would I convert JSON to YAML?
The most common cases are writing Kubernetes manifests, Docker Compose files, GitHub Actions workflows, or Ansible playbooks — all of which use YAML but whose data often originates as JSON from an API or config tool. YAML is also easier to read and supports comments, making it preferable for config files humans maintain.
Can I control the indentation?
Yes — use the indent buttons to switch between 2-space and 4-space indentation. Both are widely accepted; 2 spaces is the Kubernetes and GitHub Actions convention.
Is my data sent to a server?
No. All conversion happens in your browser using JavaScript. Your JSON never leaves your device.