JSON ↔ YAML

JSON ↔ YAML Converter

Paste JSON or YAML, pick a direction, and get cleanly formatted output with types preserved. Errors point to the exact line and column. Nothing is uploaded or executed.

Back

Convert

Strict JSON · safe YAML
Paste JSON or YAML, then choose a direction.

Comments and anchors in YAML are not kept after conversion. Custom YAML tags are rejected, never executed.

About this tool

About JSON ↔ YAML Converter

JSON ↔ YAML Converter converts data between JSON and YAML in both directions. JSON is read by a strict parser and YAML by a safe loader using the YAML 1.2 core schema, so types such as strings, numbers, booleans and null are preserved. Errors show the exact line and column, and both sides can be copied or downloaded.

Configuration files, APIs and deployment tools often use different formats — for example JSON from an API and YAML for Kubernetes or Docker Compose. Converting by hand is slow and error-prone, especially with quoting and indentation. This tool converts reliably and explains exactly where a document is invalid.

How to use

Step by step

  1. Paste JSON into the JSON box or YAML into the YAML box, or press Load sample.
  2. Choose the indentation you want for the output.
  3. Press JSON → YAML or YAML → JSON.
  4. If an error appears, read the line and column and use Go to error to jump to it.
  5. Copy the result or download it as a .json or .yaml file.
Key features

What it offers

  • Two-way conversion in separate editable panels
  • Strict JSON parsing with line-and-column errors
  • Safe YAML loading — custom tags are rejected, never executed
  • Data types preserved, with ambiguous strings quoted in YAML
  • Multiple YAML documents converted to a JSON array
  • Indentation options for both formats
  • Copy and Download for JSON and YAML
Best practices

Tips for best results

  • Validate the converted output in the tool that will use it.
  • Keep comments in your original YAML file — JSON cannot store them.
  • Quote values like yes, no, on and off in YAML if older tools read your files.
  • Avoid numbers larger than 9,007,199,254,740,991; store them as strings instead.
  • Use two-space indentation for YAML unless your project uses another style.
Benefits

Why people use it

Both directions

One tool for JSON → YAML and YAML → JSON.

Exact errors

Line and column for every parse error.

Safe

Input is parsed as data and never executed.

Private

Conversion runs entirely in your browser.

FAQ

Common questions

Yes for normal data: strings, numbers, booleans, null, arrays and nested objects convert both ways. Strings that look like numbers or booleans, such as "007" or "true", are quoted in YAML so they stay strings.
No. JSON has no comments, so comments are dropped when converting YAML to JSON, and anchors and aliases are expanded into plain values.
The YAML 1.2 core schema plus merge keys (<<): mappings, sequences, block and flow styles, multi-line strings, anchors and aliases, and multiple documents. Custom tags such as !!js/function or !!binary are rejected rather than executed.
A file with several documents separated by --- becomes a JSON array with one item per document, and the tool tells you so.
No. JSON is read by a strict parser and YAML by a safe loader that only creates plain data; nothing in your input is run as code.
Common causes are trailing commas, single quotes, comments, or unquoted keys — none are allowed in JSON. The error message shows the exact line and column, and Go to error selects that spot.
Numbers beyond JavaScript’s precision (larger than 9,007,199,254,740,991) are rounded, and the tool warns you when that happens.
Private by design

This runs entirely in your browser

No file or text you enter here is uploaded. Encoding and decoding happen on your device using native browser APIs — close the tab and nothing remains on a server.

Install Toolisco Add it to your device for offline, one-tap access.