piapia123
en

YAML ↔ JSON Converter

Format

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Turn a YAML config into JSON, or the other way round. Multi-document files (the ones separated by ---, as in a single Kubernetes manifest holding several resources) become a JSON array instead of losing everything after the first document; anchors, aliases and << merge keys are expanded into their actual content rather than being left behind as a literal << key. Parsing uses a complete YAML implementation, so block scalars, flow style and implicit typing all behave — a hand-rolled "good enough" subset will eventually read some input as something else entirely, and by the time the config is deployed there is nothing left to point at. Errors come with a line and column.

Features

  • Both directions, detected automatically or set by hand
  • Multi-document YAML becomes a JSON array — nothing after the first --- is dropped
  • Anchors and aliases are expanded, and << merge keys are resolved
  • Big integers are handled as BigInt: values beyond 2^53 become strings so no digits are lost
  • Parse errors point at a line and column instead of saying "invalid format"
  • Output shape: expanded, or compacted onto one line; JSON indent of 2 / 4 spaces or a tab
  • Syntax-highlighted output, so a long config stays readable

How to use

  1. Paste YAML or JSON — anything that parses as JSON is treated as JSON, the rest as YAML
  2. The result appears as you type; the direction can also be set by hand
  3. Pick compact to collapse it onto one line, or choose the indentation
  4. Click Copy to take the result

FAQ

Where did the comments, anchors and formatting go?
JSON has no structure that can carry comments or anchors — only objects, arrays and scalars. Anchors and aliases are expanded into what they point at, which is lossy but semantically correct; comments can only be dropped. If a comment matters, keep it somewhere outside the JSON.
Why did a big integer become a string in the JSON?
JSON has no big-integer type, and JavaScript numbers stop distinguishing adjacent integers past 2^53: 9007199254740993 quietly becomes ...992. Rather than emit a number that looks right and is off by one, it is emitted as a string — the type changes, the value does not, and you can see the change in the result.
Is yes / no a boolean here?
No. This follows YAML 1.2: yes, no, on and off are plain strings, and only true and false are booleans. That distinction matters — a YAML 1.1 parser reading the same file turns `password: no` into a boolean, and your password becomes false.
Is my input uploaded?
No. Parsing and conversion happen entirely in the browser and the page sends no requests — config files often carry keys, connection strings and internal addresses, and none of it leaves the machine.

Related tools