JSON ⇄ YAML Converter

Two-way JSON and YAML conversion that runs entirely in your browser. Paste or load a .json / .yaml file, flip the direction, and copy or download the result.

All conversions happen locally in your browser. Your files never leave your device.

—

How It Works

The converter is two-way: JSON to YAML parses with the built-in JSON.parse and serializes with js-yaml, and YAML to JSON does the reverse. Conversion runs automatically as you type (debounced by a quarter of a second), and a syntax error in either direction shows the parser message on a red line and clears the output.

Why YAML
YAML is the language of configuration files — Kubernetes manifests, GitHub Actions workflows, Ansible playbooks. The block style is far more readable than the equivalent JSON: no braces, no commas, and keys and comments can sit at the top level of the document. Comments are allowed in YAML but have no counterpart in JSON, which is why they never survive a conversion.
Dump Options
The JSON to YAML output uses a 2-space indent, block style for sequences and mappings, no anchors or aliases (the js-yaml default), and strings are only quoted when they have to be — plain text like hello stays unquoted.
Key Order
Key order is preserved when dumping to YAML: js-yaml emits the properties in the order they appear in the source document, which is also the order JSON.parse stores them in the object.
What Is Lossy
Comments are dropped in both directions (JSON cannot carry them and the parser discards YAML ones). Multi-document YAML files separated by --- are not supported — this tool parses a single document, so split a stream and convert each part separately. Duplicate keys in JSON collapse to the last value, as the format requires.
Date-like Strings
YAML 1.1 famously resolved bare values like 2024-01-01 to native date objects. The parser used here follows the modern core schema instead: we verified that date-like strings load as plain strings and are dumped with quotes ('2024-01-01'), so they survive a round trip as text and never silently turn into timestamps.

Frequently Asked Questions

Do comments survive the conversion?

No. JSON has no comment syntax at all, so JSON to YAML cannot add any, and YAML to JSON drops every comment while parsing. If you keep commented config, copy the comments over by hand after converting.

How are arrays and objects represented?

JSON objects become YAML mappings (key: value) and JSON arrays become block sequences (- item), with all nesting preserved in both directions. An array of objects turns into the familiar list of dash-prefixed records used by Kubernetes and CI files.

Will my dates or version numbers change type?

No. Older YAML 1.1 parsers resolved bare values like 2024-01-01 to date objects, but the parser here keeps date-like and version-like values as strings and quotes them on output, so a JSON string stays a YAML string and survives a round trip.

Can I convert very large files?

Everything runs in your browser tab, so file size is limited by your available memory. A few megabytes of JSON or YAML convert instantly; very large documents (tens of megabytes) can briefly freeze the tab while they are parsed and serialized.

Is my data uploaded to a server?

No. Parsing, serializing, copying and downloading all happen locally in your browser. Your documents are never sent anywhere, so confidential configs stay on your device.