Code Tools

JSON to YAML

All tools

Convert JSON into readable block-style YAML for config files and manifests.

How it works

Four simple steps

1

Paste JSON

Add an object or array from an API, CLI or config export.

2

Library loads

js-yaml is fetched from a CDN on first use.

3

YAML is written

Block maps and dash lists with two-space indentation appear live.

4

Save out.yaml

Copy the YAML or download it for your repo.

JSON to YAML

About JSON to YAML

An API or a CLI gives you JSON, but the place it needs to go, a Helm values file, a GitHub Actions workflow or a Compose service, expects YAML. Rewriting braces as indentation by hand invites mistakes.

Paste valid JSON and the converter parses it, then writes YAML using the dump function of js-yaml. Objects become indented block maps, arrays become dash lists, and strings are quoted only when they need to be, for example when a value like "true", "1.0" or "null" would otherwise be read back as a different type. Indentation is two spaces. The output updates as you type and downloads as out.yaml.

Key order follows the JSON input, and very long strings may be folded across lines by the dumper; both are normal YAML and parse back to the same data. If the JSON does not parse, the error appears under the panels and nothing is written. Validate the YAML as a sanity check before committing, or run the reverse conversion to confirm the round trip. To start a service definition from scratch, the Docker Compose generator builds the file from form fields.

The dump library is loaded once from jsDelivr; the JSON you paste is converted in this tab and stays there.

Keyboard shortcut

Ctrl Enter - Run tool
FAQ

Frequently asked questions

See all FAQs

Answers for this tool. For site-wide help, open the FAQ hub.

The dumper adds quotes only where a plain value would change type when read back. A string like "8080" keeps its quotes so it stays a string, while hello needs none.

No. Output always uses block style, which is what most config files and reviewers expect.

A built-in fallback writer takes over. It produces valid YAML but quotes every string and is less polished, so allow cdn.jsdelivr.net if you convert often.

View more FAQs

Related tools

View all

HTML Formatter

Beautify and indent HTML markup.

Open

CSS Formatter

Format and pretty-print CSS.

Open

JS Formatter

Beautify JavaScript code.

Open

JSON Formatter

Beautify and validate JSON.

Open

Explore 321 free tools

Everything you need as a developer, marketer or creator - in one beautiful place.

Browse all tools