Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

JSON to YAML Converter

JSON

Paste JSON, or

CtrlV paste · Ctrl↵ run now

YAML
Ready
Ln 1, Col 1
Runs in your browser. Nothing you paste is uploaded unless you share it.

Convert JSON to clean, readable YAML for Kubernetes, Docker Compose, GitHub Actions or OpenAPI

Turn JSON into readable YAML for Kubernetes, Compose, CI pipelines or OpenAPI specs. Switch direction to go back.

How to use it

  1. Paste JSON on the left, or open a .json file.
  2. Choose 2 or 4 spaces for the YAML indent.
  3. Copy or download the YAML. Use "Swap" to edit the YAML and convert it back.

Example

API config to YAML

Input
{"server": {"port": 8080, "hosts": ["a.example.com", "b.example.com"]}, "debug": false}
Result
server:
  port: 8080
  hosts:
    - a.example.com
    - b.example.com
debug: false

How values are written

Strings are left unquoted when YAML can read them back as the same string, and quoted when they would otherwise turn into something else ("true", "1.0", "null", values starting with special characters). That includes "yes", "off" and "0755", which older YAML 1.1 parsers such as PyYAML read as booleans and numbers.

Numbers keep every digit, including 64-bit integers that JavaScript would round. A number with an exponent gets a dot and a sign, 1e-7 as 1.0e-7, because YAML 1.1 parsers read 1e-7 as text.

A string with line breaks becomes a block (|-), one line of YAML per line of text. The keys << and = are quoted, since YAML 1.1 gives them a meaning of their own.

Questions

Is all JSON valid YAML?
Practically yes: YAML 1.2 is a superset of JSON, so a YAML parser can read JSON. Converting makes it readable: block style, no braces, no quotes where they are not needed.
Will comments survive?
JSON has no comments, so there are none to keep. When converting YAML to JSON , comments are dropped because JSON cannot hold them.
Is my config uploaded?
No. Everything runs in your browser, so your config stays on your device. Nothing you paste is uploaded unless you share a result, which is locked with your password first. Kubernetes manifests, CI files and .env-style configs often hold secrets, and the page warns you if it spots any.

Related tools