tigtools

JSON to YAML Converter

Paste JSON and get block-style YAML for a config file, Kubernetes manifest or CI pipeline. Nothing is uploaded.

Runs in your browser No sign-up

Indentation

Convert YAML to JSON instead

How to use it

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

How it works

The JSON is parsed strictly; syntax errors are explained with their line and column (trailing commas, single quotes, comments and similar). The data is then written as block-style YAML with the open-source yaml library, keeping key order and never wrapping long strings.

Strings that an older YAML 1.1 parser would read as something else are quoted: yes, no, on, off, numbers with leading zeros such as 0777, and date-like values such as 2024-01-31. This way the YAML means the same thing whichever parser reads it. Multi-line strings are written so that line breaks are preserved.

JSON numbers, booleans and null map directly to YAML. For the other direction use YAML to JSON, or the two-way JSON ⇄ YAML converter.

Examples

Kubernetes manifest

Paste the JSON from kubectl get -o json and get the same object as YAML you can edit and apply.

Values that must stay strings

{"enabled": "on", "mode": "0755"} becomes enabled: "on" and mode: "0755", so neither turns into a boolean or an octal number.

Frequently asked questions

Why are some values in quotes?

Because without quotes some YAML parsers would read them as booleans, numbers or dates. Quoting keeps them strings.

Can I convert JSON with comments?

No. Comments are not valid JSON; the error message shows where the comment is so you can remove it.

Is key order kept?

Yes. Keys are written in the same order as in the JSON.

Privacy

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