JSON → YAML

About the JSON ↔ YAML playground

The JSON ↔ YAML converter transforms data between JSON and YAML in either direction. Paste JSON to get clean, indented YAML, or paste YAML to get strict JSON — the conversion preserves objects, arrays, strings, numbers, booleans, and null. This is handy when moving configuration between systems, since many tools accept one format but not the other, and YAML is often preferred for human-edited config files.

JSON is a compact, brace-and-bracket data format that is ubiquitous in APIs. YAML (YAML Ain't Markup Language) is a superset of JSON that uses indentation instead of braces, supports comments, and is generally easier for people to read and write. Because every JSON document is also valid YAML, conversion is lossless for the shared data model; the converter simply re-expresses the same structure in the target syntax.

HostedJSON ↔ YAML runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

External resources

  • yaml.org— Official website

Input (JSON)

{
  "name": "Ada",
  "active": true,
  "roles": ["admin", "author"]
}

Output (YAML)

name: Ada
active: true
roles:
  - admin
  - author

Input (YAML)

server:
  host: localhost
  port: 8080
  tags:
    - web
    - api

Output (JSON)

{
  "server": {
    "host": "localhost",
    "port": 8080,
    "tags": ["web", "api"]
  }
}

Input (JSON with null & nesting)

{
  "db": {
    "name": "app",
    "replica": null,
    "ports": [5432, 5433]
  }
}

Output (YAML)

db:
  name: app
  replica: null
  ports:
    - 5432
    - 5433

Input (YAML array of objects)

users:
  - name: Ada
    age: 36
  - name: Linus
    age: 54

Output (JSON)

{
  "users": [
    { "name": "Ada", "age": 36 },
    { "name": "Linus", "age": 54 }
  ]
}

Input (JSON)

{
  "title": "Hello: World",
  "count": 0,
  "enabled": false
}

Output (YAML)

title: "Hello: World"
count: 0
enabled: false

Input (YAML with quoted zip)

address:
  city: Paris
  zip: "01234"

Output (JSON)

{
  "address": {
    "city": "Paris",
    "zip": "01234"
  }
}

Input (JSON nested arrays)

{
  "matrix": [[1, 2], [3, 4]],
  "labels": []
}

Output (YAML)

matrix:
  - - 1
    - 2
  - - 3
    - 4
labels: []

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

Both directions

Paste JSON to get clean, indented YAML.

Paste YAML to get strict, valid JSON back.

Objects, arrays, strings, numbers, booleans, and null all round-trip faithfully.

How the structure maps

JSON braces and brackets become YAML indentation and dashes for sequences.

Since every JSON document is valid YAML, the shared data model converts losslessly.

YAML output favors readable, human-editable indentation over inline braces.

When to use it

Moving config between tools that accept only one of the two formats.

Producing human-friendly YAML config from API-style JSON.

Privacy

Conversion runs entirely in your browser in both directions — nothing is uploaded.

Paste real config values safely; they stay on your machine.

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It converts data between JSON and YAML in both directions, re-expressing the same objects, arrays, and scalar values in the target format.
Yes. You can convert JSON to YAML or YAML to JSON. Since JSON is a subset of YAML, both directions preserve the data structure.
No. The conversion runs entirely in your browser, so your data is never sent to a server.
Yes, it is free to use with no accounts or limits.
JSON has no comment syntax, so YAML comments (lines starting with #) are dropped during conversion to JSON. The data values are preserved.
json
yaml

Output

YAML output

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup