Converters

JSON ↔ YAML Converter

Convert between JSON and YAML in your browser — nothing is uploaded.

  • Free forever
  • No sign-up
  • Runs in your browser
Share X LinkedIn
Indent

JSON input

YAML output

Your converted YAML will appear here.

Conversion runs entirely in your browser with no upload, no account and no history. Paste config you would never send to a random web server.

What this JSON ↔ YAML converter does

JSON and YAML describe the same thing — structured data: objects, arrays, strings, numbers and booleans. They just write it differently. This tool reads whichever one you paste, builds the underlying data structure in your browser, and serialises it back out in the other format. Pick a direction, paste your text, and the result appears live as you type. There is no button to wait on, no file to upload, and no account to create.

Because both the parsing and the output happen locally in your browser, the converter is a safe place for the kind of data these formats usually hold: deployment manifests, CI pipelines, application config, and package.json-style files that are full of internal hostnames, tokens and secrets.

JSON vs YAML: what's the difference?

Both formats are interchangeable for most data, but they were designed with different priorities.

JSON (JavaScript Object Notation) is strict and compact. It uses braces and brackets, requires double-quoted keys, and forbids comments and trailing commas. That rigidity is a feature: almost every language and API speaks JSON, and there is little room for ambiguity. The cost is readability — deeply nested JSON becomes a wall of punctuation.

YAML (YAML Ain't Markup Language) is a superset-style format built for humans. It uses indentation instead of braces, drops most quotes, and supports comments with #. The same data is usually shorter and far easier to scan, which is why tools like Docker Compose, Kubernetes, GitHub Actions and Ansible standardised on it. The trade-off is that whitespace becomes significant, so small indentation mistakes can change meaning or break parsing.

When to use each format

  • Reach for JSON when a program, API or config schema demands it; when you want a single-line, unambiguous payload; or when you are passing data between services. JSON's strictness makes it predictable.
  • Reach for YAML when a human edits the file regularly — infrastructure config, CI/CD pipelines, app settings — and you want comments and a clean, low-noise layout. YAML's readability pays off in files people maintain by hand.

A common workflow is to author or generate data as JSON, then convert it to YAML for a config file that your team will edit, and convert back to JSON when a tool insists on it. That round trip is exactly what this converter is for.

How to use the converter

  1. Choose a direction — JSON → YAML or YAML → JSON — using the toggle at the top.
  2. Paste your text into the input pane. The output appears immediately in the second pane.
  3. Set the indent (2 or 4 spaces) to match your project's style. It applies to both YAML and JSON output.
  4. Fix any error. If the input is invalid, the output pane turns into a clear, line-aware error message instead of silently producing nothing.
  5. Copy or download the result. Download saves a .yaml or .json file directly from your browser.

Flipping the direction reuses your last valid output as the new input, so you can convert back and forth without re-pasting.

Common pitfalls (and how to avoid them)

These are the mistakes that trip people up most often when moving between the two formats:

  • Tabs in YAML. YAML forbids tab characters for indentation; you must use spaces. A file that looks fine in your editor can fail because a tab sneaked in. If conversion fails on a line that looks correct, check for tabs.
  • Trailing commas in JSON. JSON does not allow a comma after the last item in an object or array. YAML has no commas to forget, so this only bites going into JSON-strict tools — but it's the number-one reason hand-written JSON won't parse, and a quick pass through the JSON formatter flags the offending line before you convert.
  • Unquoted special values in YAML. Strings like yes, no, on, off and null can be read as booleans or null. A version number like 1.10 may lose its trailing zero as a float. Quote values when you need them treated as text.
  • Colons inside unquoted strings. A YAML value such as time: 10:30 is ambiguous; wrap it in quotes so the parser doesn't read the inner colon as a new key.
  • Comments don't survive. JSON has no comments, so any # notes in your YAML are dropped on the way to JSON and can't come back. Keep your annotated source if those notes matter.

Why convert in your browser instead of on a website's server

Most online converters send whatever you paste to a remote server to do the work. For config files that's a real exposure: these formats routinely contain database passwords, API tokens, private endpoints and customer data. You usually have no idea whether that server logs the request, caches the result, or keeps it around.

That risk isn't hypothetical. In November 2025 a widely used online JSON service was caught publicly exposing pastes that users assumed were private, turning a quick formatting job into a data leak. The lesson is simple: a tool that ships your data off-device is the wrong tool for anything sensitive.

This converter takes the opposite approach. The parser runs in your browser, the conversion happens on your machine, and the data never crosses the network. Nothing is uploaded, nothing is stored, and there's no account tying the work to you. Convert freely — including the secrets-laden files you'd never paste into a server-side tool — knowing the data stayed yours the entire time.

Frequently asked questions

Comet's got your back

Stuck on something? Every tool has a short guide and FAQ — and Comet can point you to the right spot.

Visit help centre