iPGaze

JSON ↔ YAML

Convert between JSON and YAML.

Results appear as you type

Everything runs locally in your browser — your input never leaves this page.

About the JSON ↔ YAML

JSON ↔ YAML converts data between the two most common configuration formats in both directions. Paste JSON to get readable YAML for your config files, or paste YAML to get strict JSON for an API or program. The conversion is handled in your browser, so your configuration data stays local.

How to use

  1. Paste your JSON or YAML into the input area.
  2. Select the direction you want to convert.
  3. Review the converted output for correctness.
  4. Copy the result into your config file or application.

Where the two formats disagree, and why conversion can surprise you

YAML is a superset of JSON, so converting JSON to YAML is always safe. The other direction is where things go wrong, because YAML can express structures JSON has no way to represent: anchors and aliases that let one node be referenced in several places, multiple documents in a single file separated by `---`, comments, and non-string keys. All of that is flattened or lost on the way to JSON.

The classic failure is type coercion. In the older YAML 1.1 behaviour that many parsers still implement, unquoted `yes`, `no`, `on` and `off` become booleans — so a country code `NO` becomes `false`, and a config key set to `on` becomes `true`. Sexagesimal parsing is the other one: an unquoted `22:30` can be read as the number 1350. Quote any value whose meaning depends on it being text.

Two more that cost debugging time. Leading zeros make a value look octal to some parsers, so a zip code or a phone number written unquoted can come back as an unexpected integer. And YAML forbids tab characters for indentation entirely — an editor that inserts tabs produces a file that fails to parse with an error message pointing at a line that looks perfectly aligned.

Frequently asked questions

Why convert between JSON and YAML?
YAML is easier for humans to read and write in config files, while JSON is widely used by APIs and programs, so converting lets you move between the two.
Does the conversion preserve nested structures?
Yes. Nested objects and arrays are mapped between the equivalent JSON and YAML structures.
Is my configuration data uploaded?
No. The conversion runs entirely in your browser, so nothing you paste is sent to a server.

Related Developer tools