Skip to content
UniKit

JSON to YAML

Convert JSON to YAML with two-space indentation, arrays as lists, no long-line folding, and quotes added to strings that would otherwise read as numbers or booleans. Parsing stays in your browser.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

JSON input

Paste standard JSON and get default js-yaml output: two-space indentation, no long-line folding, and quotes added to strings that would otherwise read as numbers or booleans.

YAML output

Produced by js-yaml dump with anchors disabled, so repeated objects are written out in full instead of &ref/*ref.

Paste JSON to see the YAML

What this tool does

  • Convert a JSON config into the YAML that Kubernetes and CI pipelines expect
  • Turn an API response into YAML for an issue or doc where brackets hurt readability

Example

Input

{"name":"Ada","age":37,"tags":["dev","ops"]}

Output

name: Ada
age: 37
tags:
  - dev
  - ops

Two-space indentation, arrays written as - lists.

Frequently asked questions

Does it also convert YAML back to JSON?

No. This tool only does JSON→YAML; use the sibling YAML↔JSON tool for the other direction.

Why are some strings quoted?

In YAML, yes, no, true, null and 8080 can be interpreted as booleans or numbers, so js-yaml quotes values that were strings in the source (port: '8080') to keep the round trip faithful.

Are anchors and aliases emitted?

No. References are disabled (noRefs), so a shared object is written out in full each time instead of &anchor / *alias.

Are long strings folded?

No. lineWidth is set to -1 so long strings stay on one line; real newlines use the |- block style.

Keywords:json to yamljs-yaml

Related tools