tigtools

YAML to JSON Converter

Paste YAML (a Kubernetes manifest, CI file, OpenAPI spec or config) and get formatted JSON instantly. Nothing is uploaded.

Runs in your browser No sign-up

Indentation

Convert JSON to YAML instead

How to use it

  1. Paste YAML into the input, or try the example.
  2. Choose 2 or 4 spaces of indentation.
  3. Copy the JSON or download it as a .json file.

How it works

The YAML is parsed with the open-source yaml library using the YAML 1.2 core schema, which is what modern tools expect: yes, no, on and off stay strings, and only true and false are booleans. Anchors (&name) and aliases (*name) are expanded and << merge keys are applied; the number of alias expansions is limited, so deliberately exploding documents are rejected instead of freezing the page.

A file with several documents separated by --- becomes a JSON array with one element per document. Comments, anchors and tags have no JSON equivalent and are dropped; keys keep their order. Timestamps stay strings. Integers with more than about 15 digits lose precision, as with any JSON handled in JavaScript.

If the YAML is invalid, the first error is shown with its line and column, for example a tab used for indentation or a missing closing bracket. For the other direction use JSON to YAML, or the two-way JSON ⇄ YAML converter.

Examples

CI file with anchors

A job list that reuses a defaults block with <<: *defaults becomes JSON with the defaults copied into each job, so you can see exactly what each job gets.

Multi-document Kubernetes file

A file with a Deployment and a Service separated by --- becomes a JSON array of two objects, ready for kubectl or jq.

Frequently asked questions

Why does yes stay a string?

YAML 1.2, used here and by most current tools, treats only true and false as booleans. Older YAML 1.1 parsers turned yes, no, on and off into booleans, which caused many bugs.

What happens to comments?

JSON has no comments, so they are dropped. The data itself is unchanged.

Is there a size limit?

Only your browser's memory. Large files are converted after a short pause while you type, so the page stays responsive.

Privacy

The conversion runs entirely in your browser. Your YAML and JSON are not uploaded or stored.