JSON ⇄ YAML

Convert JSON to YAML and YAML to JSON both ways, privately in your browser — with type-safe values and clear error messages.

Translate between JSON and YAML in either direction

JSON and YAML describe the same shapes of data — maps, lists, strings, numbers, booleans and null — but they look very different. JSON wraps everything in braces, brackets and double quotes, which is fast for machines to parse. YAML throws most of that punctuation away and uses indentation instead, which is far easier for a human to read and edit. This tool parses whichever format you paste into a real in-memory structure and re-serialises it as the other, so the data is identical and only the syntax changes.

The converter is fully indentation-aware in both directions, so nested objects, lists, lists of objects and objects inside lists all round-trip correctly. It is also type-safe: when emitting YAML it automatically quotes any string that would otherwise be misread — for example the string "true" or "3.14" — so the value survives a trip back to JSON unchanged.

A worked example

This compact JSON object…

{"app":"toolsy","port":8080,"debug":true,"hosts":["a","b"]}

…becomes this clean, comment-friendly YAML:

app: toolsy
port: 8080
debug: true
hosts:
  - a
  - b

How the same values look in each format

Data primitiveJSONYAML
Map / object key"name": "ada"name: ada
List of scalars[1, 2, 3]- 1 on three lines
Booleantruetrue
Nullnullnull
Number-like string"007""007" (quoted)
Empty list / map[] / {}[] / {}

YAML is the configuration language behind Docker Compose, Kubernetes manifests, GitHub Actions and Ansible, while JSON is the wire format of nearly every REST API. Converting between them lets you lift an API response straight into a config file, or turn a hand-written config into a payload a program can consume — without re-typing it and introducing a stray comma.

Privacy note: every conversion happens on your device with no server and no network request. It is safe to paste config that contains hostnames, credentials or tokens here — none of it leaves this browser tab.

Frequently asked questions

Is my JSON or YAML uploaded anywhere?

No. Both directions of the conversion run entirely in your browser using JavaScript. Your configuration files, secrets, API tokens and personal data are never sent to a server, logged or stored — close the tab and everything is gone.

Why did my YAML fail to convert to JSON?

The two most common causes are inconsistent indentation (YAML is whitespace-sensitive, so mixing tabs and spaces or misaligning a nested block breaks the structure) and using a colon inside an unquoted value, like url: http://x. Wrap such values in quotes. The error message points to the line that could not be parsed.

Does the converter preserve data types?

Yes. Numbers stay numbers, true/false stay booleans, and null stays null in both directions. When converting JSON to YAML, the tool also quotes any string that would otherwise be misread as a number, boolean or null — for example the string "true" is emitted as "true" so it survives a round trip.

Can it handle nested objects and arrays?

Yes. The YAML emitter and parser are both indentation-aware, so deeply nested maps, lists, lists of objects and objects inside lists all convert correctly in either direction.

Does it support YAML comments and anchors?

Comments (lines or trailing text starting with #) are recognised and skipped when reading YAML, since JSON has no equivalent. Advanced features such as anchors (&), aliases (*) and multiple documents (---) are intentionally not supported to keep the parser predictable and dependency-free.