RealJSON
Try now

JSON to YAML Converter

Convert JSON to clean, readable YAML. Perfect for Kubernetes configs, Docker Compose files, GitHub Actions workflows, and any config-as-code pipeline.

Indent

Options

JSON Input

YAML Output

 

In short: A JSON to YAML converter rewrites JSON's brace-and-bracket syntax as YAML's indentation-based syntax — same data, different format, which infrastructure tools like Kubernetes and Docker Compose expect. RealJSON's converter does this instantly in your browser with configurable indentation and smart string quoting.

JSON to YAML — Convert Instantly in Your Browser

JSON and YAML represent the same data structures but with very different syntax. JSON is the format of the web — API responses, SDKs, and config files often produce it. YAML is the format of infrastructure — Kubernetes manifests, Docker Compose files, Helm charts, GitHub Actions, and Ansible playbooks all use it.

This converter translates any valid JSON into properly indented YAML, running entirely in your browser. No data leaves your machine.

Common Use Cases

  • Convert a JSON API spec into a Kubernetes ConfigMap or Secret manifest
  • Translate a JSON config into a Docker Compose environment block
  • Move JSON settings into a GitHub Actions workflow input
  • Convert Terraform JSON output to YAML for Helm chart values
  • Produce readable YAML from programmatically generated JSON

YAML Output Details

String Quoting

Strings that would be ambiguous in YAML (booleans, numbers, special characters) are automatically quoted. Plain strings without special characters are written unquoted for readability. The "force quote strings" option wraps every string value in quotes.

Arrays and Nested Objects

JSON arrays become YAML sequences with - list items. Nested objects become indented mappings. The structure is preserved exactly.

Indentation

Choose 2-space (default, common in Kubernetes and Helm) or 4-space indentation to match your project's conventions.

Frequently Asked Questions

How do I convert JSON to YAML?

Paste your JSON in. Properly indented YAML appears instantly — pick 2-space or 4-space indentation, then copy it or download as a .yaml file.

Why convert JSON to YAML for Kubernetes or Docker Compose?

JSON is common in API responses and SDKs, but infrastructure tools like Kubernetes, Helm, Docker Compose, and GitHub Actions use YAML for configuration — converting lets you reuse JSON data directly in those formats.

How does the converter decide whether to quote strings?

Strings that would be ambiguous in YAML — looking like booleans, numbers, or containing special characters — are quoted automatically. Plain strings stay unquoted for readability, and a "force quote strings" option quotes everything.

Are JSON arrays and nested objects preserved in the output?

Yes — arrays become YAML sequences with "-" list items, and nested objects become indented mappings. The structure is preserved exactly.

Is my JSON uploaded to a server during conversion?

No. Conversion runs entirely in your browser — your data never leaves your machine.

Related Tools

If your JSON has errors, use the JSON Repair tool first. To generate test JSON before converting, try the Correlated JSON Generator.

Browse all free JSON tools →