JSON ⇆ YAML Converter

Convert JSON to YAML and YAML to JSON in both directions, with clear error messages. Everything runs in your browser — your data is never sent anywhere and nothing is stored.

How the converter works

  1. Paste your JSON or YAML into the input box.
  2. Click JSON → YAML to turn JSON into readable YAML, or YAML → JSON to turn YAML into pretty-printed JSON.
  3. If the input is malformed, the error line tells you what went wrong; otherwise copy the result with one click.

Under the hood the tool parses your text into a data structure and then serialises it to the other format, so values, arrays and nested objects map across exactly. Remember that JSON needs double quotes and no trailing commas, while YAML uses spaces (never tabs) for indentation and drops any comments when converted to JSON.

More PAYATE tools

Frequently asked questions

What is the difference between YAML and JSON?

JSON (JavaScript Object Notation) uses braces, brackets and quotes and is compact and strict — great for APIs and data interchange. YAML (YAML Ain't Markup Language) uses indentation instead of braces, allows comments and reads more like plain text — so it is popular for configuration files such as Docker Compose, Kubernetes and CI pipelines. Both describe the same kinds of data, so you can convert losslessly between them.

Is my data uploaded anywhere?

No. Conversion runs entirely in your browser using the open-source js-yaml library — nothing is uploaded to a server and nothing is stored. It is safe for config and data you would not want to transmit.

Does it keep my comments?

No. When you convert YAML → JSON the comments are dropped, because JSON has no concept of comments. Converting JSON → YAML also cannot invent comments. If preserving comments matters, keep your original YAML file as the source of truth.

Why did my conversion fail?

The most common causes are a trailing comma or single quotes in JSON (JSON requires double quotes and no trailing commas), and inconsistent indentation or tab characters in YAML (YAML requires spaces, not tabs). The error line below the buttons shows the exact message and, where available, the line and column so you can fix it quickly.