←
Data

JSON to YAML

Loading the tool…

Ready when you are.Runs in this browser · nothing is uploaded

Convert JSON ⇄ YAML

  • Free
  • No sign-up
  • No upload
  • Works offline

Tool facts

Opens
JSONYAMLYML
Saves as
YAMLJSON
Price
Free, no sign-up, no watermark
Are files uploaded?
No. Everything is processed in this browser, on your device.
Batch processing
One file at a time
Offline use
Works without a connection once this page has loaded
Built with
js-yaml
Browser
A recent Chrome, Edge, Firefox or Safari, on computer or phone.

Check it yourself: press F12, open the Network tab, then use the tool. No request carries your data.

About JSON to YAML

JSON to YAML converts JSON into clean, indented YAML and YAML back into JSON, in either direction with one click. It is useful for configuration files such as Kubernetes manifests, Docker Compose files, GitHub Actions workflows and OpenAPI specs, which are usually written in YAML but often generated or processed as JSON. Paste your data and the converted result appears as you type, ready to copy or download.

The conversion uses js-yaml with the YAML 1.2 core schema. Strings that other parsers might misread, such as yes, no, 01000 or dates, are quoted in the YAML output, so the data keeps exactly the same types. Multi-line strings become readable block scalars. YAML files with several documents separated by --- become a JSON array. Comments and anchors are not part of the data model, so they do not survive a round trip. Everything runs locally.

JSON to YAML runs entirely in your browser. Your data is processed on your device and is never uploaded to Qiyi or anyone else.

How to use JSON to YAML

  1. Choose JSON → YAML or YAML → JSON under Direction, or simply drop a .json, .yaml or .yml file and the direction is set for you.
  2. Paste or edit your data in the first box; the result box below or beside it updates as you type.
  3. Pick the indentation and turn on Sort keys A–Z if you want keys in alphabetical order.
  4. Click Copy or Download, or Swap to convert the result back.

Frequently asked questions

Is YAML a superset of JSON?

Almost. Since YAML 1.2, any valid JSON document is also valid YAML, so a YAML parser can read JSON directly. YAML adds comments, anchors, multi-line strings and indentation-based structure, which make it easier for people to write by hand.

Why are some values quoted in the YAML output?

Values such as yes, no, on, off, 1.0 written as text, dates or numbers with leading zeros could be read as booleans, numbers or timestamps by older YAML 1.1 parsers. Quoting keeps them as strings everywhere, which is important for things like version numbers and postal codes.

What happens to YAML comments?

Comments are not part of the data, so they are dropped when YAML is converted to JSON, which has no comment syntax. Converting the JSON back to YAML cannot restore them.

How are multiple YAML documents handled?

If the YAML contains several documents separated by ---, as Kubernetes files often do, the JSON output is an array with one element per document. A single document becomes a single JSON value.

Where is the error in my YAML?

When the YAML is invalid, the status shows the reason with the line and column, and the output box shows the surrounding lines with a marker under the problem. Common causes are tabs used for indentation, inconsistent indentation and a missing space after a colon.

· Free · Runs in this browser · nothing is uploaded

Drop any file here
Drop it to see which tools can open it