JSON Input

YAML Output

What is JSON to YAML Converter?

Your API hands back JSON, but the Helm chart, the Compose file and the GitHub Actions workflow all want YAML. This page rewrites a JSON document as YAML with the same keys, the same order and the same values, so a generated config or a captured response can go into a manifest without being retyped line by line.

According to MDN Web Docs, both JSON and YAML are popular data formats. YAML is often used in config files (like Docker Compose, Kubernetes, or CI/CD pipelines), while JSON is standard for APIs. The part people get bitten by is YAML's loose typing. A JSON string like "no", "0123" or "2024-01-15" would turn into a boolean, a number or a date if written bare, so the converter quotes it. Long integers such as a 19-digit ICCID are written with every digit intact.

Everything happens in your browser, so nothing you paste is uploaded. The output uses two-space indentation and block style, which is what YAML tools and reviewers expect. Key order is kept exactly as in your JSON.

How to Use the JSON to YAML Converter

Paste, check, copy. The YAML updates as you type.

1

Paste, Upload, or Load Sample

Type or paste into the JSON Input pane, or pick a .json file with Upload (it is pretty-printed into the editor first). Sample fills in two mobile subscribers plus a metadata block. A smaller test worth pasting, because two of its strings would silently change type if YAML saw them bare:

{"service": "billing-api", "replicas": 3, "port": "0080", "debug": "no", "owner": "Ingrid Holm", "tags": ["payments", "eu-west-1"]}
2

View YAML Output

The right panel shows the YAML output. Structure is preserved. Invalid JSON shows an error before conversion.

3

Download or Copy

For that test input the output reads port: '0080' and debug: 'no' in single quotes, while replicas: 3 stays a plain integer and tags becomes a dash list. Copy grabs the YAML for pasting into a values file, Download writes it out as converted.yaml, and Clear wipes the input so the output empties with it.

When You'd Actually Use This

Config File Conversion

Convert JSON configs to YAML for Docker Compose, Kubernetes, or CI/CD pipelines. YAML is more readable for configuration files.

API to Config

Got JSON from an API that needs to be a YAML config? Convert it quickly. Great for generating config files from API responses.

Format Preference

Some teams prefer YAML for its readability. Convert JSON to YAML when you need that human-friendly format for configs or documentation.

Tool Compatibility

Some tools require YAML format. Convert your JSON data to YAML when working with tools like Ansible, Kubernetes, or GitHub Actions.

Common Questions

Is my JSON data stored?

No. The JSON is parsed and dumped to YAML by script running in this tab, with no request sent anywhere, so a values file holding a database password never leaves your machine. Reload the page and it is gone.

What JSON formats work?

Any valid JSON. A top-level object becomes a list of key: value lines, a top-level array becomes a dash list, and a bare value such as 42 or "hello" comes out as a one-line YAML document. JSON with comments or trailing commas is rejected with the parser's message in the output pane, so run it through the JSON Fixer first.

How are nested objects handled?

Each level of nesting adds two spaces. Arrays of objects are written with the dash on the first key, like - subscriberId: SUB-1001, and the remaining keys line up under it. JSON null becomes null, and an empty object or array is written inline as {} or [].

Can I convert YAML back to JSON?

Yep. Use our YAML to JSON converter to convert YAML files back to JSON format.

What if my JSON has special characters?

Strings that contain colons, #, quotes or leading spaces are quoted so YAML reads them back as the same string. Strings YAML would otherwise reinterpret (yes, off, ~, null, 0123, 1e3, dates) are quoted too. Bare yes and off were booleans in YAML 1.1. The YAML 1.2.2 spec narrowed booleans to true and false, but plenty of parsers still read files the 1.1 way, so quoting is the only choice that is safe everywhere.

Does it work with large datasets?

A few MB of JSON converts in well under a second. Parsing happens in your browser's memory, so for files in the hundreds of MB, yq -P on the command line is the better tool.

Other JSON Tools You Might Need

If the YAML looks wrong, the problem usually started in the JSON. Validate or format it first, or go the other way when someone sends you YAML back: