Google PlayGoogle Play
Temp Mail Logo

Temp Mail safeguards your privacy while keeping your inbox free from spam.

⚙️ JSON · YAML · Config Files · Kubernetes · Docker Compose · GitHub Actions

JSON to YAML Converter

Free JSON to YAML converter. Instantly convert any JSON object or array to clean, properly indented YAML. Handles nested objects, arrays, all data types, and special characters automatically.

✓ Instant conversion✓ Nested objects✓ All data types✓ Special chars handled✓ No signup
JSON Input
YAML Output
What this tool does

Free JSON to YAML converter: convert JSON configs to YAML for Kubernetes, Docker, and GitHub Actions

How JSON to YAML conversion works and why YAML is preferred for configuration files

This JSON to YAML converter transforms any valid JSON into properly indented YAML using a client-side converter that runs entirely in your browser. It handles all JSON data types, strings, numbers, booleans, null, arrays, and nested objects, and automatically quotes strings that contain special characters or would otherwise be misinterpreted by YAML parsers (such as reserved words like true, false, null, yes, no, on, off).

YAML is the preferred format for infrastructure and deployment configuration because it supports comments, is more concise than JSON, and reads naturally. Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, and Helm charts are all written in YAML. This tool is useful when you have a JSON config (perhaps exported from an API or generated by a tool) that you need to convert to YAML for use in these systems.

The conversion preserves all data faithfully. Nested objects become indented YAML mappings, arrays become YAML sequences with dash prefixes, and scalar values use their natural YAML representations. No data is lost or transformed in meaning.

Features and capabilities
Live Conversion
Updates as you type, paste JSON and YAML appears instantly.
Nested Objects
Deep object nesting is correctly represented with YAML indentation.
Arrays
JSON arrays become YAML sequences with proper dash-space prefix.
Type Preservation
Numbers, booleans, and null convert to their YAML equivalents.
Auto-Quoting
Strings with special chars or reserved words are automatically quoted.
Copy to Clipboard
One-click copy of the YAML output.
100% Client-Side
Nothing sent to a server, safe for sensitive config data.
No Signup
Paste and convert instantly.
Examples

JSON to YAML examples: config files, arrays, nested objects

Side-by-side JSON input and YAML output for common configuration patterns
Docker ComposeService configuration: nested objects and arrays
JSON Input: {"version":"3","services":{"web":{"image":"nginx:latest","ports":["80:80","443:443"],"environment":{"NODE_ENV":"production"}}}} YAML Output: version: "3" services: web: image: nginx:latest ports: - 80:80 - 443:443 environment: NODE_ENV: production
A typical Docker Compose service definition. The nested 'services > web' structure becomes nested YAML indentation. The ports array (which would conflict in JSON with numbers) becomes a YAML sequence. The string '3' for version is quoted to prevent it being parsed as a number.
KubernetesPod spec: booleans, numbers, and null values
JSON Input: {"apiVersion":"v1","kind":"Pod","metadata":{"name":"my-pod","labels":{"app":"web"}},"spec":{"restartPolicy":"Always","hostNetwork":false,"priority":10,"tolerations":null}} YAML Output: apiVersion: v1 kind: Pod metadata: name: my-pod labels: app: web spec: restartPolicy: Always hostNetwork: false priority: 10 tolerations: null
A Kubernetes Pod spec. Booleans (false) and numbers (10) are preserved as their native YAML types without quotes. Null values are rendered as 'null'. The indentation mirrors the JSON nesting, making the structure immediately clear.
FAQ

Frequently asked questions about JSON to YAML conversion

What is YAML?
YAML (YAML Ain't Markup Language) is a human-readable data serialisation format commonly used for configuration files. It uses indentation to represent nested structures, making it more readable than JSON for complex configurations. YAML is the standard format for Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, Ruby on Rails database.yml, and many other DevOps and web development tools. It supports comments (unlike JSON), multiline strings, and references/anchors.
When should I use YAML instead of JSON?
Use YAML for configuration files that humans read and edit frequently. It is more concise and supports comments. Use JSON for API responses, data exchange between services, and anywhere where a programming language needs to parse the data automatically. YAML is a superset of JSON, meaning valid JSON is also valid YAML. The main practical difference: YAML allows # comments, uses indentation instead of braces, and doesn't require quoting string values in most cases.
Are there any data types that don't convert perfectly?
Most JSON data types convert cleanly to YAML. Strings, numbers, booleans, null, arrays, and objects all have direct YAML equivalents. One edge case: JSON has no concept of YAML anchors or aliases. Another: YAML has special reserved words (true, false, yes, no, on, off, null) that this tool automatically quotes if they appear as string values in your JSON, to prevent them from being misinterpreted as booleans or null by YAML parsers.
How does indentation work in YAML?
YAML uses consistent indentation to represent nesting. Similar to Python. This tool uses 2-space indentation, which is the most common convention. Each nested level is indented 2 more spaces than its parent. Arrays use a dash-space (- ) prefix for each item. The indentation must be consistent. Mixing tabs and spaces, or using inconsistent indent depths, causes YAML parse errors. This is why editing YAML by hand can be error-prone, and why tools like this converter are useful.
Why are some strings quoted in the YAML output?
YAML parsers interpret certain unquoted strings as special types. For example, true, false, yes, no, on, off are interpreted as booleans. null and ~ are interpreted as null. Numbers are parsed as numeric types. Strings containing special characters like : # { } [ ] are ambiguous. To preserve these as strings, this tool wraps them in double quotes. If you see unnecessary quotes in the output, they are there to ensure the YAML is parsed correctly by any compliant YAML parser.

Need a disposable email address?Get a free instant throwaway email. No signup, no trace.

Get Free Temp Mail →