Skip to main content

JSON ⇄ YAML Converter

Convert data between JSON and YAML in your browser — free, fast and no upload.

What is JSON ⇄ YAML conversion?

YAML is a favorite for config files — it replaces JSON’s braces with indentation, which is easier to read and write. JSON is the universal format for code and APIs. This tool converts between the two, so you can feed a config file to your program or turn an API response into readable YAML. Everything runs locally in your browser, with no upload.

How to use

  1. Paste JSON or YAML into the input box (you can also drop in a file).
  2. Click JSON → YAML or YAML → JSON.
  3. Copy or download the result; if the syntax is invalid, the status bar explains why.

Common use cases

  • Turn a JSON API response into readable YAML config.
  • Convert hand-written YAML config into JSON your code can parse.
  • Need to beautify or validate JSON? Pair it with the JSON formatter; to move to spreadsheets use JSON ⇄ CSV ⇄ Excel.

Why did my YAML comments disappear after converting to JSON?

Convert a Docker Compose or CI YAML config to JSON for a program to read, and you'll notice the # comments are all gone — that's expected, not a bug: JSON has no comment syntax, so there's nowhere to put them. Two other YAML traps worth knowing: indentation must use spaces, never mixed tabs — one space off and the meaning changes; and unquoted no / yes / on / off become booleans, so the country code NO can turn into false — quote values that look like booleans. Want to tidy the JSON afterwards? Follow up with the JSON formatter.

Frequently Asked Questions

Is my data uploaded?

No. Conversion runs entirely in your browser with JavaScript (js-yaml). What you paste is never sent to a server or stored.

What is the difference between JSON and YAML?

YAML uses indentation and line breaks instead of JSON’s braces and commas, so it is easier for people to read and write — common for config files (Docker Compose, Kubernetes, CI). Both express the same data structures and convert losslessly.

Does converting lose anything?

The data itself (objects, arrays, strings, numbers, booleans, null) converts losslessly. However, YAML comments disappear when converting to JSON because JSON has no comments, and anchors are expanded.

Which YAML version is supported?

It uses js-yaml, compatible with YAML 1.1/1.2, supporting the mainstream syntax: block indentation, flow (inline) style, multi-line strings, anchors and references.

Related reading

JSON vs YAML: What's the Difference and How to Convert →

Embed this tool

Add this tool to your own website or blog for free — just copy and paste the code below (it includes a link back to this site).