YAML → JSON

About the YAML → JSON playground

YAML → JSON parses human-friendly YAML and outputs the equivalent JSON. Mappings become objects, sequences become arrays, and scalars become strings, numbers, booleans, or null. Because every JSON document is itself valid YAML, the two formats share a common data model, making this handy for feeding config files written in YAML into tools and APIs that expect JSON.

YAML (YAML Ain't Markup Language) is an indentation-based data serialization format prized for readability in configuration and CI pipelines. JSON (JavaScript Object Notation) is a stricter, brace-and-bracket format that's the lingua franca of web APIs. This converter resolves YAML's indentation, anchors, and scalar types into explicit JSON structure, so you can move from authoring convenience to machine-friendly interchange.

HostedYAML → JSON 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 (YAML)

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

Output (JSON)

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

Input (YAML nested)

server:
  host: localhost
  port: 8080

Output (JSON)

{
  "server": {
    "host": "localhost",
    "port": 8080
  }
}

Input (YAML scalars)

count: 42
ratio: 3.14
label: "01234"
note: null

Output (JSON)

{
  "count": 42,
  "ratio": 3.14,
  "label": "01234",
  "note": null
}

Input (YAML list of maps)

users:
  - id: 1
    name: Ada
  - id: 2
    name: Linus

Output (JSON)

{
  "users": [
    { "id": 1, "name": "Ada" },
    { "id": 2, "name": "Linus" }
  ]
}

Input (YAML multiline string)

message: |
  line one
  line two
title: Demo

Output (JSON)

{
  "message": "line one\nline two\n",
  "title": "Demo"
}

Input (YAML flow style)

point: { x: 1, y: 2 }
tags: [red, green, blue]

Output (JSON)

{
  "point": { "x": 1, "y": 2 },
  "tags": ["red", "green", "blue"]
}

Input (YAML anchors & aliases)

defaults: &defaults
  retries: 3
  timeout: 30
prod:
  <<: *defaults
  timeout: 60

Output (JSON)

{
  "defaults": {
    "retries": 3,
    "timeout": 30
  },
  "prod": {
    "retries": 3,
    "timeout": 60
  }
}

How it works

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

Workflow

Paste indentation-based YAML on the left; the tool parses it into a data model.

Mappings emit as JSON objects, sequences as arrays.

Scalars resolve to JSON strings, numbers, booleans, or null.

What it handles

Anchors and aliases are dereferenced into expanded JSON values.

Block and flow styles both parse to the same structure.

Implicit typing (e.g. true, 42, null) is resolved, not left as text.

Privacy

YAML is parsed locally in your browser; nothing is uploaded.

Safe for config files that contain tokens or secrets.

Tips

Every JSON doc is valid YAML, so you can round-trip JSON back through it.

Use it to feed YAML configs into JSON-only APIs and tooling.

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 parses a YAML document and emits the equivalent JSON, mapping YAML mappings to objects and sequences to arrays.
No. Conversion runs in your browser, so your YAML is never transmitted to a server.
Yes, completely free with no limits.
Quote them in YAML, e.g. zip: "01234", so they aren't coerced into numbers in the JSON output.
A single document maps cleanly to one JSON value; multi-document streams separated by --- are typically handled as the first document or an array depending on the option.
yaml
json

Output

JSON 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