YAML ↔ JSON Converter

Convert YAML to JSON and JSON back to YAML, with real parsing rather than guesswork — nothing you paste is uploaded.

The first conversion downloads a 39 KB YAML parser from jsDelivr. Your text is never uploaded — the parsing happens in this tab.

🔒 Runs entirely in your browser — nothing you type is uploaded or stored on a server.

This converter turns YAML into JSON and JSON back into YAML. It matters that it uses a real parser: YAML looks simple until you meet anchors and aliases, block scalars, flow collections, multi-document streams and implicit typing. A hand-rolled parser gets those quietly wrong, and quietly wrong is the worst outcome when the file is a Kubernetes manifest or a CI pipeline.

Also on Txtset: format and validate the JSON you get out · do the same thing with XML.

So the first time you press Convert, the page downloads js-yaml 4.1.0 (39 KB) from a CDN, pinned to an exact version and checked with Subresource Integrity so a tampered file cannot run. That is the only network request this tool makes. Your text is never uploaded — the parsing happens in this tab, and once the parser is cached the page works offline.

One behaviour worth knowing before you trust the output, because tools disagree about it. This follows YAML 1.2 core, so no, yes, on and off stay strings and only true/false become booleans. Older YAML 1.1 tools turn no into false — which is how the famous “Norway problem” ate a country code. If you need no to be a boolean, write false.

Going the other way, long strings are never hard-wrapped and anchors are never invented for you, because both of those surprise people who then have to explain the diff. Keys can be sorted alphabetically, which makes two generated files comparable in a review.

How to use

  1. Pick a direction — YAML → JSON or JSON → YAML.
  2. Paste your document into the input box.
  3. Choose an indent width, and tick Sort keys if you want a stable, comparable ordering.
  4. Press Convert. The first press downloads the parser; every press after that is instant.
  5. Copy the result or download it as a file.

Examples

A config block
name: my-app
replicas: 3
ports:
  - 8080
becomes {"name": "my-app", "replicas": 3, "ports": [8080]}
The Norway problem
country: no converts to {"country": "no"} — a string, not false, because this follows YAML 1.2.
A multi-document stream
Two documents separated by --- convert to a JSON array of two objects.

Frequently asked questions

Is my YAML uploaded anywhere?
No. The only thing that crosses the network is the parser library itself, downloaded once from jsDelivr on your first conversion. Your document is parsed in this tab and never transmitted.
Why does it download a library at all?
Because YAML is a much larger specification than it looks, and a converter that is subtly wrong about block scalars or anchors will corrupt a real config file. Using the reference JavaScript implementation is the honest choice. It is pinned to version 4.1.0 and verified with Subresource Integrity, so the file that runs is the exact file we checked.
Does <code>no</code> become <code>false</code>?
No. This follows YAML 1.2 core schema, where only true and false are booleans, so no, yes, on and off stay strings. YAML 1.1 tools behave differently — that difference is the origin of the “Norway problem”, where the country code NO silently became a boolean.
Can it handle multiple documents in one file?
Yes. A stream of documents separated by --- converts to a JSON array, one entry per document. A single document converts to a single object.
What happens if my YAML has a syntax error?
You get the parser's own message together with the line and column where it gave up, and the output box is left empty rather than showing a half-converted document.
Does it work offline?
After the first conversion, yes — the parser is cached by your browser. The very first conversion needs a connection.