JSON to YAML Converter

Convert JSON to YAML
online, free & instant

Paste your JSON and get clean, readable YAML output in one click. No signup, no server — conversion happens entirely in your browser.

Open JSON to YAML Converter

Clean YAML output in three steps

Paste your JSON Drop any valid JSON object or array into the input — as compact or pretty-printed as you like.
Select YAML output Switch to the Convert tab and choose YAML. The converter runs immediately, no button required.
Copy the result One-click copy puts the YAML on your clipboard, ready to drop into a config file or pipeline.
Also exports CSV & XML The same Convert tab also supports JSON to CSV and JSON to XML — no extra tools needed.

No account. No upload. No nonsense.

🔒

No Server

Your JSON never leaves your device. There is no backend to send it to.

Zero Dependencies

Single self-contained HTML file. No frameworks, no CDN calls, nothing to break.

📡

Works Offline

Load once and use forever — even on a plane or without internet access.

Related JSON tools

JSON Formatter Pretty-print JSON with syntax highlighting and a collapsible tree view.
JSON Minifier Strip all whitespace and compress JSON to the smallest valid form.
JSON to TypeScript Generate typed TypeScript interfaces from your JSON structure instantly.
JWT Decoder Decode and inspect JWT tokens — header, payload, and expiry status.

Common questions answered

Is JSON to YAML conversion free?

Yes, free with no account needed.

Does JSON to YAML conversion happen offline?

Yes, all conversion is done in your browser — no data is sent to a server.

Is the converted YAML valid?

Yes. The converter produces standards-compliant YAML 1.2.

Can I convert large JSON files to YAML?

Yes, the converter handles large files efficiently.

What JSON types map to in YAML?

JSON objects become YAML mappings, arrays become sequences, strings stay strings, numbers and booleans map directly, and null becomes ~.

What is YAML?

YAML (YAML Ain't Markup Language) is a human-readable data serialization format widely used for configuration files. Unlike JSON, YAML uses indentation instead of braces, supports comments, and allows multi-line strings. It is the standard format for Kubernetes manifests, Docker Compose files, Ansible playbooks, and GitHub Actions workflows.

JSON and YAML are fully interconvertible: every valid JSON document has an equivalent YAML representation. This tool converts JSON to YAML 1.2, preserving all data types and structures. Objects become YAML mappings with key: value pairs, arrays become dash-prefixed sequences, and primitives map directly to their YAML equivalents.

Convert JSON to YAML
Input
{
  "name": "Alice",
  "roles": ["admin", "editor"],
  "settings": {
    "theme": "dark",
    "notify": true
  }
}
Output
name: Alice
roles:
  - admin
  - editor
settings:
  theme: dark
  notify: true

Get the most out of this tool

Ready to convert your JSON?

Free forever. No signup. Instant results.

Convert JSON to YAML now

JSON to YAML conversion in depth

YAML (YAML Ain't Markup Language) is a human-friendly data serialization format that uses indentation to represent structure, similar to Python. While JSON uses curly braces and square brackets, YAML represents objects as key-value pairs separated by colons and arrays as dash-prefixed list items. YAML is a superset of JSON — every valid JSON document is also valid YAML — but YAML's native syntax is far more concise for configuration files.

The conversion from JSON to YAML is straightforward because every JSON construct has a direct YAML equivalent. JSON objects become YAML mappings: the braces are removed, each key-value pair appears on its own line with a colon separator, and nesting is expressed through increased indentation rather than brackets. JSON arrays become YAML sequences: the square brackets are removed, and each element is preceded by a hyphen and a space on its own line.

YAML offers significant advantages over JSON for human-authored configuration. YAML supports comments (# comment), multi-line string blocks (using | or > block scalars), and anchors (&anchor) with aliases (*anchor) for reusing repeated values. None of these features exist in JSON. For configuration files like CI/CD pipelines (GitHub Actions, GitLab CI), Kubernetes manifests, and Docker Compose files, YAML is the standard choice precisely because of these capabilities.

String quoting in YAML is optional for simple values. A YAML string like name: Alice does not need quotes around Alice. However, strings that look like other YAML types — booleans (true, false, yes, no, on, off), numbers, null, or strings containing special characters — must be quoted. The converter handles this automatically, adding quotes only where necessary to prevent ambiguity.

YAML has a common gotcha: boolean coercion. In YAML 1.1 (used by older parsers like PyYAML by default), the strings "yes", "no", "on", and "off" are parsed as booleans. This frequently causes bugs in Kubernetes labels, Ansible variables, and CI configuration where the letter "no" or a country code like "NO" (Norway) is unintentionally treated as false. YAML 1.2 eliminated this ambiguity, and the converter follows the safer YAML 1.2 conventions.

Kubernetes and Helm chart development is one of the most common contexts where JSON-to-YAML conversion is needed. Kubernetes API objects are defined in JSON internally but almost universally written as YAML. Helm charts use YAML templates. When a tool generates JSON output (like kubectl get pod -o json), converting it to YAML makes editing and storing the configuration much more practical.

When developers use this tool

Kubernetes manifest creation Convert a JSON export from a running Kubernetes resource into a YAML manifest you can store in version control, modify, and re-apply as a declarative configuration file.
GitHub Actions workflow development GitHub Actions workflows are YAML. When you have JSON configuration from a tool or API, convert it to YAML and embed it in your workflow file as an environment variable or step input.
OpenAPI specification editing OpenAPI specs can be written in JSON or YAML. Convert from JSON to YAML for editing and human review — YAML is significantly more readable for long API definitions with many operations.
Ansible and configuration management Ansible playbooks and variables are YAML. Convert JSON data from an API or database export to YAML variables files for use in Ansible roles without manual reformatting.

Additional frequently asked questions

Is YAML always better than JSON for config files?

YAML is more readable for humans but has more parsing edge cases (boolean coercion, indentation sensitivity, multiple syntax variants). JSON is stricter and has fewer surprises. Use YAML when humans edit the file frequently; use JSON when the file is primarily machine-generated or when you want guaranteed parse behavior.

Can I convert YAML back to JSON?

Yes. The YAML to JSON converter on this site handles the reverse conversion. YAML that uses only JSON-compatible features (no anchors, no block scalars, no multi-document streams) converts cleanly to JSON. YAML-specific features like comments and anchors are lost in the conversion since JSON has no equivalents.

Why does YAML sometimes parse "yes" as true?

YAML 1.1 (used by PyYAML and many older parsers) treats "yes", "no", "true", "false", "on", and "off" as boolean values. YAML 1.2 restricts booleans to only "true" and "false". Always quote strings that look like booleans in YAML config files to avoid this ambiguity, regardless of the parser version.

Does YAML support all JSON data types?

Yes. YAML is a superset of JSON, so it supports all JSON types: strings, numbers, booleans, null, objects (mappings), and arrays (sequences). YAML additionally supports timestamps, binary data, and ordered mappings — types that have no direct JSON equivalent but are rarely needed when the use case is storing JSON-originated data.