JSON to YAML Converter

Paste JSON — clean YAML output appears instantly. Free, no signup required.

Direction
Indent:
JSON Input
Auto-converts on paste
YAML Output

YAML will appear here
Paste JSON on the left

Input: -
Output: -
Lines: -

Free Online JSON to YAML Converter — No Signup Required

Convert JSON to YAML (or YAML back to JSON) instantly with our free online converter. Paste any valid JSON into the left panel and get clean, human-readable YAML output in real time — no button clicks, no accounts, no server uploads. Toggle to YAML → JSON mode to reverse the conversion. Processing happens entirely in your browser using js-yaml v4your data never leaves your device.

How to Use This JSON to YAML Converter

  1. Select JSON → YAML or YAML → JSON from the direction toggle in the toolbar
  2. Paste your input into the left panel — conversion starts automatically
  3. Adjust the indent width (2 or 4 spaces) from the dropdown on the right of the toolbar
  4. Click Copy YAML (or Copy JSON) to send the result to your clipboard
  5. Click Download .yaml (or Download .json) to save the file directly

What is YAML?

YAML (YAML Ain't Markup Language) is a human-readable data serialization format designed for configuration files and data that needs to be edited by people. It uses indentation to represent structure instead of braces and brackets, making it significantly less noisy than JSON for complex nested configs.

YAML is the native format for Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, Helm charts, and most CI/CD pipeline configs (CircleCI, Travis CI, GitLab CI). The workflow of pulling a JSON API response or config and converting it to YAML is extremely common in DevOps and infrastructure work — which is exactly what this tool is for.

JSON vs YAML — When to Use Each

Feature JSON YAML
Syntax Braces, brackets, commas, all strings quoted Indentation-based, minimal punctuation
Human-editable Moderate Excellent
API payloads Universal standard Rarely used
Config files Common Preferred (K8s, Docker, CI/CD)
Comments Not supported Supported (#)
Whitespace-sensitive No Yes — indentation matters
Browser parsing Native (JSON.parse) Requires library (js-yaml)

Example Conversion

Input JSON:

{
  "name": "my-app",
  "version": "1.0.0",
  "replicas": 3,
  "enabled": true,
  "tags": ["production", "web"],
  "resources": {
    "cpu": "500m",
    "memory": "256Mi"
  }
}

Output YAML:

name: my-app
version: 1.0.0
replicas: 3
enabled: true
tags:
  - production
  - web
resources:
  cpu: 500m
  memory: 256Mi

Common Use Cases

When you need to format or validate the JSON before converting, use our JSON Formatter. To compare two JSON structures, try our JSON Diff tool. For unique ID generation, see the UUID Generator.

Frequently Asked Questions

Is this JSON to YAML converter free?
Yes, completely free. No signup, no account, no rate limits. All conversion runs in your browser — there is no backend service processing your data. Works offline once the page is loaded.
Can I convert YAML back to JSON?
Yes. Click the YAML → JSON toggle in the toolbar. Paste your YAML on the left and get formatted JSON on the right. The conversion is bidirectional — the same tool handles both directions.
What JSON types does the converter support?
All JSON types: objects (mapped to YAML mappings), arrays (mapped to YAML sequences with - indicators), strings (quoted when necessary), numbers, booleans (true/false), and null. Nested structures of any depth are handled correctly.
Is the YAML output valid for Kubernetes and Docker Compose?
Yes. The output is standard YAML 1.2 produced by js-yaml, which is compatible with all YAML parsers used in Kubernetes, Docker Compose, GitHub Actions, Ansible, Helm, and other DevOps tooling. Always review the output before deploying to production configs.
What library does the converter use?
The conversion uses js-yaml v4.1.0, the most widely used JavaScript YAML library with over 100 million weekly npm downloads. It produces spec-compliant YAML 1.2 output and is used in tools like webpack, ESLint, and many CI/CD systems.
Is my data safe?
Completely. The conversion runs entirely in your browser using JavaScript. Your JSON or YAML data is never sent to any server. This is especially important for sensitive configs containing API keys, credentials, or private infrastructure details — they stay on your machine.
Why does YAML use fewer quotes than JSON?
YAML only quotes strings that would be ambiguous without quotes — strings that look like numbers ("123"), booleans ("true"), or null ("null"). Plain strings like my-app or New York don't need quotes. The converter handles this automatically via js-yaml's dump rules.
What is the difference between YAML 1.1 and YAML 1.2?
YAML 1.1 treated yes, no, on, off as booleans, which caused many subtle bugs (e.g., country code "NO" for Norway parsed as false). YAML 1.2 (2009) fixed this — only true and false are booleans. This converter uses js-yaml 4.x which is YAML 1.2 compliant by default. Kubernetes uses a YAML 1.2 parser as well.
Does YAML support comments?
Yes — YAML supports comments with the # character (everything after # on a line is a comment). JSON does not support comments. This converter does not add comments to output, but if you're editing YAML manually after conversion, you can freely add them. Note: comments are stripped if you then parse the YAML back to JSON.
How do I convert a JSON array to YAML?
Paste your JSON array directly (e.g., ["a", "b", "c"]) into the input. The converter handles root-level arrays — you'll get a YAML sequence with - list indicators. Arrays nested inside objects also convert correctly.
Why is my YAML indented with 2 spaces instead of 4?
2-space indentation is the default and is the convention used by most Kubernetes, Docker Compose, and GitHub Actions configs. You can change to 4 spaces using the Indent dropdown in the toolbar. Both are valid YAML.