JSON to YAML Converter

Paste JSON, get clean YAML. Instant, private and free.

Output options

JSONinput

Empty

YAMLoutput

YAML 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 the converter works

Three steps, no sign-up, and your data never leaves your device.

  1. Add your JSON

    Paste it, drop a file, upload, or load it from a URL. Try a sample to see how it works.

  2. Tune the output

    Pick indentation, quotes and sorting. The YAML preview updates live as you change options.

  3. Copy or download

    Copy the YAML, download a .yaml file, or share a link to the exact conversion.

Private by design

Conversion happens in your browser with JavaScript. Your JSON is never uploaded, logged or stored on a server.

Live conversion

YAML updates as you type, with syntax highlighting, line numbers and conversion stats. Large files switch to on-demand mode.

Full output control

Choose indentation, quote style, line width, inline (flow) depth, array indentation, key sorting and a leading --- marker.

Errors you can act on

Invalid JSON is explained in plain language with the exact line and column, and one click jumps to the problem.

Lenient JSON parsing

Comments, trailing commas, single quotes and unquoted keys are accepted, so config files and JSON5 snippets just work.

Multi-document and JSON Lines

Split a top-level array into separate YAML documents. NDJSON / JSON Lines logs are detected automatically.

Safe for tricky values

Strings like "yes", "007" or "null" are quoted so they stay strings, and 64-bit integers keep every digit.

YAML to JSON too

Flip the direction with one click. Anchors, merge keys and multi-document YAML are resolved into plain JSON.

Load, save and share

Upload or drop a file, fetch from a URL, download the result, or copy a share link that stores the data in the link 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.

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"  }}
YAML
name: web-apiversion: '1.10'replicas: 3debug: falseowner: nulltags:  - api  - internalports:  - name: http    port: 80    expose: trueenv:  LOG_LEVEL: info  COUNTRY: 'NO'

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

How JSON types become YAML

Every JSON value has a direct YAML equivalent, so converting JSON to YAML never loses data.

JSON typeJSONYAMLWhat happens
Object{"port": 80}port: 80One key per line; nesting is shown by indentation
Array["a", "b"]- a / - bEach item on its own line, starting with a dash
String"web"webWritten without quotes when that is safe
Look-alike string"yes", "007"'yes', '007'Quoted, so it stays a string in every parser
Number3.5, 90071992547409933.5, 9007199254740993Written as is; big integers keep every digit
BooleantruetrueOnly true and false are written, never yes or on
NullnullnullKept as null (YAML also reads ~ as null)
Multi-line string"a\nb\n"| then one line eachBecomes a literal block that keeps the line breaks
Empty object / array{}, []{}, []Written inline

Why some strings get quoted

YAML guesses the type of unquoted text, and YAML 1.1 parsers guess differently from YAML 1.2. Pick a value or type your own to see how each one reads it.

YAML 1.1 parsers

PyYAML, Go yaml.v2 and the tools built on them

YAML 1.2 core schema

The current YAML specification

This converter writes

For the JSON string, with YAML 1.1 safe on

Multi-line strings: | keeps lines, > folds them

Block scalars are how YAML writes long text. Edit the lines and switch the style to see exactly what a parser reads.

Style
Final line breaks

You write

The parser reads

The converter writes that string as

JSON vs YAML

Both describe the same data. JSON is strict and ideal for machines and APIs; YAML is easier for people to read and edit, which is why Kubernetes, Docker Compose, GitHub Actions, Ansible and OpenAPI use it for configuration.

FeatureJSONYAML
StructureBraces, brackets and commasIndentation and dashes
CommentsNot supportedSupported with #
StringsAlways double-quotedQuotes usually optional
Multi-line textEscaped \nBlock scalars | and >
ReuseNoneAnchors and aliases
Multiple documentsNo (JSON Lines is a workaround)Yes, separated by ---
Best forAPIs, data exchange, storageConfiguration, CI/CD, infrastructure
JSON
{
  "service": "api",
  "replicas": 3,
  "ports": [80, 443],
  "env": { "DEBUG": false }
}
YAML
service: api
replicas: 3
ports:
  - 80
  - 443
env:
  DEBUG: false

Supporting tools

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

Frequently asked questions

How do I convert JSON to YAML?

Paste your JSON into the left editor, upload a .json file or load it from a URL. The YAML appears on the right instantly. Adjust indentation or quoting if needed, then copy or download the result.

Is my data sent to a server?

No. The converter runs entirely in your browser, so your JSON never leaves your device. Share links also keep the data inside the link itself (after the # symbol), which browsers do not send to servers.

Why are some strings quoted in the YAML output?

Values such as yes, no, on, off, null, 007 or 1.10 would be read as booleans, nulls or numbers by many YAML parsers. The converter quotes them so they stay strings. Turn off "YAML 1.1 safe" if you only target YAML 1.2 parsers and prefer fewer quotes.

Can it handle JSON with comments or trailing commas?

Yes. With "Lenient JSON" enabled the tool accepts JSONC and JSON5-style input: // and /* */ comments, trailing commas, single-quoted strings and unquoted keys. Disable it to validate against strict JSON.

What happens to very large numbers?

Most converters silently round integers above 9,007,199,254,740,991 because of JavaScript number limits. This tool preserves big integers such as 64-bit IDs digit for digit in modern browsers.

How do I create a multi-document YAML file?

Enable "Multi-document" and every item of a top-level JSON array becomes its own YAML document separated by ---. JSON Lines (one JSON object per line) is detected and converted the same way, which is handy for Kubernetes manifests.

Are there usage limits?

The tool is free. To keep it fast and discourage bots, fair-use limits apply: inputs up to 5 MB, a generous number of conversions per minute and hour, and a limited number of URL fetches. Normal use never reaches them.

Can I convert YAML back to JSON?

Yes. Switch the direction to YAML → JSON or press the swap button to send the current output back as input. You can pretty-print or minify the JSON and sort its keys.