JSON to YAML
Convert JSON to clean, human-readable YAML online. Turn API responses and package files into config for Kubernetes, Docker Compose or CI pipelines.
Runs in your browser · Nothing uploadedFree · No sign-up
Something not working, or missing a feature? Send feedback
About the JSON to YAML
YAML is easier for people to read and edit than JSON, which is why tools like Kubernetes, Docker Compose and GitHub Actions use it. This converter turns JSON into clean YAML.
Conversion happens in your browser, so your files and records stay private.
How to use the JSON to YAML
- Paste JSON.
- Choose the indentation.
- Copy or download the YAML.
Example
Input
{"apiVersion":"apps/v1","kind":"Deployment","metadata":{"name":"web"},"spec":{"replicas":2,"template":{"spec":{"containers":[{"name":"web","image":"nginx:1.27","ports":[{"containerPort":80}]}]}}}}Result
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 2
template:
spec:
containers:
- name: web
image: nginx:1.27
ports:
- containerPort: 80
Arrays of objects become "- " list items, and strings are quoted only where needed.
Common mistakes
- Strings that look like other types. Values such as "yes", "1.10" or "08:00" must stay quoted in YAML or other parsers may read them as booleans, numbers or times. The converter quotes them for you; keep the quotes when editing.
- Editing with tabs. If you edit the YAML afterwards, indent with spaces. YAML does not allow tabs for indentation.
- Expecting comments. JSON has no comments, so the YAML has none either. Add them after converting.
Works well with the JSON to YAML
- YAML to JSON: convert the YAML back to JSON.
- YAML Validator: check how the YAML will be parsed.
- YAML Formatter: reformat the YAML after editing it.
Frequently asked questions
Are strings quoted?
Only when needed, for example values that would otherwise be read as numbers, booleans or dates.
Is the conversion lossless?
Yes. Converting the YAML back to JSON gives the same data.
Will kubectl accept the output?
Yes. Kubernetes reads YAML and JSON the same way, so the converted manifest is equivalent to the JSON one.
Is the key order kept?
Yes. Keys appear in the same order as in the JSON.
Guides and tutorials
Related tools
JSON to CSV
Convert JSON arrays to CSV online with automatic column detection, nested object flattening and custom delimiters. Open the result in Excel or Sheets.
CSV to JSON
Convert CSV to a JSON array online with header detection, type inference and delimiter auto-detection. Turn spreadsheet exports into data for APIs and code.
JSON to XML
Convert JSON to well-formed XML online with a configurable root element and attribute support. Validate the input and download the XML file.
XML to JSON
Convert XML to JSON online, keeping attributes and turning repeated elements into arrays. Malformed XML is reported with its location.
YAML to JSON
Convert YAML documents to formatted JSON online with syntax validation. Errors are reported by line, so broken indentation is quick to find and fix.
JSON to PHP Array
Convert JSON to a PHP array literal online, using short [] or long array() syntax. Paste API responses straight into PHP code, tests and config files.