JSON to YAML and YAML to JSON Converter

Convert between JSON and YAML in either direction — YAML to JSON or JSON to YAML. Handles nested objects, arrays, anchors, and multi-line strings. Runs entirely in your browser.

Runs 100% in your browser — nothing is uploaded.Use this in a chain
YAML output

How to use

  1. 1
    Pick a direction

    JSON → YAML or YAML → JSON. The Swap button flips it.

  2. 2
    Paste your input

    Anything from a snippet to a multi-MB config file.

  3. 3
    Copy the output

    Live update. Parse errors show inline with line numbers.

  4. 4
    Share via URL

    Your input travels in the address bar so the recipient sees the exact same conversion.

Examples

JSON → YAML
Input
{"name":"toolvaults","tools":104,"tags":["dev","text","color"]}
Output
name: toolvaults
tools: 104
tags:
  - dev
  - text
  - color
Arrays become dash-prefixed sequences. Nested objects indent.
YAML → JSON
Input
server:
  host: 0.0.0.0
  port: 8080
features:
  - auth
  - metrics
Output
{
  "server": {
    "host": "0.0.0.0",
    "port": 8080
  },
  "features": ["auth", "metrics"]
}
Types are preserved — port stays a number, not a string.
YAML with anchors
Input
defaults: &defaults
  timeout: 30
dev:
  <<: *defaults
  debug: true
Output
{
  "defaults": {"timeout": 30},
  "dev": {"timeout": 30, "debug": true}
}
YAML anchors and merge keys are resolved at parse time — the JSON is fully flattened.

Frequently asked

Does converting round-trip preserve everything?

For structured data (objects, arrays, scalars) — yes. YAML-specific things like comments, anchors, and merge keys are lost when going YAML → JSON since JSON has no equivalents. JSON → YAML → JSON is safe.

Which YAML spec is supported?

YAML 1.2 via the mature `yaml` npm package, running fully in your browser. Anchors, aliases, and merge keys are resolved at parse time and flattened into plain JSON.

What does the Swap button do?

It takes the current output, uses it as the new input, and flips direction. Useful for round-trip testing or quickly editing the converted result.

How big a document can I paste?

Anything up to a few MB. Parsing happens entirely in the browser, so there is no upload — larger inputs are limited only by your device.

What happens to YAML comments?

Comments are lost — JSON has no equivalent. Everything else (structured data, scalars, nested objects, arrays) round-trips cleanly.

Related tools