YAML and JSON

Convert config files in both directions, covering nested maps, lists, comments and block scalars.

Direction
YAML

Covers the config file subset: nested maps, lists, comments, quoted strings, inline collections and block scalars. Anchors, aliases, tags and multiple documents are not supported.

JSON

How to Convert YAML and JSON

1

Choose a direction

YAML to JSON is what you want when reading a Kubernetes manifest, a Docker Compose file or a CI pipeline. JSON to YAML is for turning an API payload into a readable config.

2

Paste the document

Indentation defines the structure in YAML, so paste it exactly as it appears in the file. Comments, quoted strings and inline collections are all understood.

3

Copy the result

Conversion runs as you type. If a line cannot be read the tool names the line number instead of producing a document that only looks correct.

Features

Both directions in one tool
Nested mappings and sequences at any depth
Sequences of mappings, the shape most config files use
Comments stripped safely, including hashes inside quoted strings
Inline flow collections written in square or curly brackets
Block scalars with the pipe and greater-than markers
Strings that look like numbers or booleans are quoted on the way out
Runs entirely in your browser, nothing is uploaded

Frequently Asked Questions

The subset configuration files actually use: nested mappings, sequences, scalars, comments, quoted strings, inline collections and block scalars. Anchors, aliases, tags, multiple documents and complex keys are not supported and are flagged rather than guessed at.

No. Conversion happens in your browser. This matters for YAML in particular, since manifests and pipeline files frequently contain hostnames, environment names and occasionally secrets.

Because it would otherwise be read back as a different type. A string such as 123, true or no gets quotes so a later parser returns your string rather than a number or a boolean.

A single document, yes. Files containing several documents separated by three dashes are not supported, so split them and convert one at a time.

No, and neither does this tool. The YAML specification forbids tabs for indentation, so use spaces. Most editors can convert them for you.

They are removed. JSON has no comment syntax, so there is nowhere for them to go when converting in that direction.

The output is regenerated from the data, not from your formatting. The structure and values match, but comments, key order in some cases, and stylistic choices are not preserved.

Yes, completely free with no sign-up, like every tool in the Pinkontin toolbox.

Need a Custom Tool or Application?

We build production-grade web applications, SaaS platforms, and developer tools. Let's talk about your project.

or book a free call