YAML to JSON Converter

Paste YAML, get valid JSON. Anchors resolved, errors pinpointed, nothing uploaded.

Output options

YAMLinput

Empty

JSONoutput

JSON output appears here

Runs entirely in your browser, so nothing is uploaded. Fair-use limits apply (5 MB per input, rate-limited conversions) to prevent spam and bots.

Load from URL

The file is fetched directly by your browser, so the server must allow cross-origin requests.

Keyboard shortcuts

Ctrl / ⌘ + Enter Convert now
Ctrl / ⌘ + S Download the output
Alt + Shift + C Copy the output
Alt + Shift + F Fix and format the JSON input
Alt + Shift + S Swap direction
Alt + Shift + T Cycle through code, tree and map views
Ctrl / ⌘ + Z Undo, including Format, Fix and Clear
Esc Leave full screen
Editor text size

How to convert YAML to JSON

Three steps, no sign-up. Everything runs locally, so it also works offline once the page has loaded.

  1. Add your YAML

    Paste it, drop a .yaml or .yml file, upload, or load it from a URL. Pick a sample to try it out.

  2. Choose the JSON style

    Pretty-print with 2, 4 or 8 spaces or minify to one line. Optionally sort keys or drop null values.

  3. Copy or download

    Copy the JSON, save it as a .json file, or share a link that carries the input in the URL itself.

See how JSON maps to YAML

The same data, line by line. Point at or tap any line to see where it ends up on the other side.

YAML
name: web-apiversion: '1.10'replicas: 3debug: falseowner: nulltags:  - api  - internalports:  - name: http    port: 80    expose: trueenv:  LOG_LEVEL: info  COUNTRY: 'NO'
JSON
{  "name": "web-api",  "version": "1.10",  "replicas": 3,  "debug": false,  "owner": null,  "tags": [    "api",    "internal"  ],  "ports": [    {      "name": "http",      "port": 80,      "expose": true    }  ],  "env": {    "LOG_LEVEL": "info",    "COUNTRY": "NO"  }}

Point at or tap a line, or focus a pane and use the arrow keys.

Anchors, aliases and merge keys are resolved

JSON has no references, so every alias is expanded into a full copy. Merge keys copy the shared defaults into each block, and local keys win.

config.yaml
defaults: &defaults
  adapter: postgres
  pool: 5
  timeout: 5000

development:
  <<: *defaults
  database: app_dev

production:
  <<: *defaults
  database: app_prod
  pool: 20
config.json
{
  "defaults": {
    "adapter": "postgres",
    "pool": 5,
    "timeout": 5000
  },
  "development": {
    "adapter": "postgres",
    "pool": 5,
    "timeout": 5000,
    "database": "app_dev"
  },
  "production": {
    "adapter": "postgres",
    "pool": 20,
    "timeout": 5000,
    "database": "app_prod"
  }
}

How YAML types map to JSON

Each YAML value becomes the closest JSON type. Quoted strings stay strings, and dates are kept as written.

app.yaml
name: web-api
port: 8080
debug: false
ratio: 0.75
owner: ~
released: 2026-10-01
version: "1.10"
tags: [api, internal]
motd: |
  Welcome!
  Maintenance at 02:00.
app.json
{
  "name": "web-api",
  "port": 8080,
  "debug": false,
  "ratio": 0.75,
  "owner": null,
  "released": "2026-10-01",
  "version": "1.10",
  "tags": [
    "api",
    "internal"
  ],
  "motd": "Welcome!\nMaintenance at 02:00.\n"
}

~ and null become null, the block scalar | keeps its line breaks as \n, and the quoted "1.10" stays a string, so it does not become the number 1.1.

Multi-document YAML becomes a JSON array

Kubernetes manifests and Helm output often hold several documents separated by ---. Each one becomes an item of a top-level array.

manifests.yaml
apiVersion: v1
kind: Service
metadata:
  name: web
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
manifests.json
[
  {
    "apiVersion": "v1",
    "kind": "Service",
    "metadata": {
      "name": "web"
    }
  },
  {
    "apiVersion": "apps/v1",
    "kind": "Deployment",
    "metadata": {
      "name": "web"
    }
  }
]

Why convert YAML to JSON?

Feed APIs and SDKs

REST APIs, AWS SDKs and most HTTP clients expect JSON bodies, even when the source of truth is a YAML config.

Query with jq

Convert a manifest or workflow to JSON to filter it with jq, JSONPath or your language's standard JSON library.

Validate with JSON Schema

Schema validators, OpenAPI tools and editors work on JSON; converting first makes errors easier to trace.

More tools

Converters, validators and step-by-step guides for every place JSON and YAML meet.

Frequently asked questions

How do I convert YAML to JSON?

Paste your YAML into the left editor, upload a .yaml or .yml file, or load it from a URL. Valid JSON appears on the right as you type. Choose 2, 4 or 8 spaces or minified output, then copy or download the .json file.

Is my YAML uploaded to a server?

No. Parsing and conversion run in your browser with JavaScript. Your YAML is never uploaded, logged or stored on a server, so it is safe for configs that contain internal hostnames or credentials.

What happens to anchors, aliases and merge keys?

They are resolved. An alias (*name) is replaced by a full copy of the anchored value, and a merge key (<<: *defaults) copies the anchored keys into the mapping, with local keys taking priority. JSON has no references, so the result is plain, expanded data.

Can I convert a multi-document YAML file?

Yes. When a file contains several documents separated by ---, each document becomes one item of a top-level JSON array, in the same order. A file with a single document converts to a single JSON value.

What happens to YAML comments?

JSON has no comment syntax, so comments are dropped during conversion. If you need to keep notes, move them into a regular key such as "description" before converting.

Why does a date stay a string in the JSON?

JSON has no date type. The converter keeps values like 2026-10-01 exactly as written, as strings, instead of turning them into a timestamp with a time zone your application did not ask for.

Why do I get "bad indentation" or "mapping values are not allowed"?

These are YAML syntax errors, usually from a tab character used for indentation, inconsistent indentation inside a block, or an unquoted value that contains ": ". The error box shows the exact line and column; Go to error moves the cursor there.