Y YamlForge
Unlimited Free Usage

YAML ⇄ JSON Converter

Convert YAML to JSON and JSON to YAML in your browser. Multi-document streams, line-precise error highlighting, YAML 1.1 boolean gotcha warnings and an anchor / merge-key visualizer — no signup, no uploads.

Input
Output

      

Errors

No errors. Convert something to validate it.

Warnings

Warnings (duplicate keys, YAML 1.1 boolean gotchas…) appear here.

Anchor / Alias / Merge-key Visualizer

Every &anchor, *alias and << merge found in the input. Click a line chip to jump to it.

Convert something containing anchors to see the graph.

Supported YAML subset — what this parser handles, honestly

YamlForge: The YAML to JSON Converter That Actually Explains Itself

If you work with configuration files, you live in two worlds. Application code speaks JSON — the strict, brace-heavy data format that every API, every JavaScript runtime, and every NoSQL database understands natively. Humans, on the other hand, write YAML — the indentation-based format behind Docker Compose files, Kubernetes manifests, GitHub Actions workflows, and Ansible playbooks. Moving data between those two worlds is a daily chore, and that is exactly what this yaml to json converter is built for. Paste YAML on the left, get clean, validated JSON on the right — or flip the direction and use it as a json to yaml converter online whenever you need human-readable config out of machine data.

Most online converters are black boxes: they either succeed silently or fail with a cryptic message. YamlForge was designed differently. It parses your input with a transparent, documented YAML subset, reports every problem with an exact line and column number, warns you about the famous YAML 1.1 boolean traps, flags duplicate keys that would silently destroy data, and even draws you a map of every anchor, alias, and merge key in your file. Everything runs 100% in your browser — your configs never leave your machine.

YAML vs JSON: Why Both Exist

JSON (JavaScript Object Notation) is a data-interchange format optimized for machines. Its grammar is tiny and unambiguous: objects in curly braces, arrays in square brackets, strings in double quotes. Every programming language ships a JSON parser, which is why APIs return JSON and why it became the default language of the web.

YAML (YAML Ain't Markup Language) is optimized for humans. It drops the braces, brackets, and most quotes, and uses indentation to express structure instead. Compare the same data in both formats. In JSON you write {"server": {"host": "web-1", "port": 8080}}; in YAML you write server: on one line and indent host: web-1 beneath it. The YAML version is easier to read, easier to comment (JSON has no comments at all), and easier to edit by hand at 2 a.m. during an outage.

That readability comes at a cost: YAML's grammar is famously subtle. Indentation must be consistent, tabs are forbidden, and — as we will see — innocent-looking words like yes and on can silently change meaning. A good converter does not just translate syntax; it protects you from these traps. That is why YamlForge doubles as a yaml validator online: every conversion is also a full validation pass.

How to Convert YAML to JSON

Using the converter takes seconds:

The JSON output is pretty-printed with your choice of 2- or 4-space indentation, ready to paste into an API client, a test fixture, or a JavaScript file.

How to Convert JSON to YAML

Switch to the JSON → YAML tab and the panes swap roles. Paste JSON — an API response, a package.json, a Terraform state excerpt — and YamlForge emits clean, idiomatic YAML: block-style mappings and sequences, minimal quoting, and literal block scalars (|) for multi-line strings so your embedded scripts and certificates stay readable.

The emitter is careful about round-tripping. Strings that would change meaning in YAML get quoted automatically: anything that looks like a number, a boolean, or null ("123", "true", "null"), anything starting with a special character, and — in YAML 1.1 mode — the notorious yes / no / on / off family. That means YAML produced here parses back to identical data, which the tool's own test suite verifies on every build.

Multi-Document YAML Streams: One File, Many Documents

One of YAML's most underappreciated features is the document stream: a single file can hold multiple independent documents separated by --- lines (optionally closed with ...). Kubernetes manifests use this constantly — a Deployment, a Service, and a ConfigMap often live in one file, each its own document.

Many converters choke on streams, converting only the first document and silently dropping the rest. YamlForge splits the stream first and converts each document independently. The output pane shows every document's JSON, joined by --- separator lines for readability — or, if you prefer, as a single JSON array of documents (choose "JSON array" in the multi-doc output option). The stats bar tells you exactly how many documents were found and converted, so nothing ever disappears quietly.

A YAML Validator Online, Not Just a Converter

Because YAML is whitespace-sensitive, the most common bugs are invisible: a line indented one space too far, a tab character hiding among spaces, a missing colon. YamlForge validates as it converts and reports problems with surgical precision:

The YAML 1.1 Boolean Gotcha (Yes Really Means True)

Here is the trap that has bitten nearly every DevOps engineer at least once. In YAML 1.1, the following are all booleans:

enabled: yes     # -> true, not the string "yes"
notify: on       # -> true, not the string "on"
region: no       # -> false — imagine this as an AWS region name
confirm: off     # -> false

The single letters y and n count too. This is not a bug in your parser — it is the specification, inherited from an era when YAML tried to be maximally clever. The result in production is configuration that looks right and behaves wrong: a feature flag set to off becomes boolean false instead of the string your application expected, or a country code no (Norway!) collapses into false.

YamlForge scans every unquoted scalar and flags each occurrence with a dedicated warning badge, showing the line, the column, and what the value actually becomes. One click on "Quote all risky values" wraps every flagged scalar in quotes across your input, neutralizing the entire class of bug at once. Prefer the modern behavior instead? Switch the boolean mode to YAML 1.2 and yes / no / on / off are treated as ordinary strings, matching what parsers like Go's gopkg.in/yaml.v3 in strict mode and most 2020s-era tooling do.

Duplicate Keys: The Silent Data Destroyer

Consider this innocent-looking YAML:

database:
  host: db-primary
  host: db-replica

Most parsers accept this without a word and keep only the last value — db-replica — while db-primary vanishes. When the duplication comes from a bad merge or a copy-paste slip, the result is data loss with zero feedback. YamlForge treats duplicate keys as a first-class warning: it names the key, gives you the line of the first definition and the line of the overwrite, and tells you plainly that the earlier value was discarded. The same check runs inside flow-style mappings ({a: 1, a: 2}).

Anchors, Aliases, and Merge Keys — Visualized

YAML's most powerful readability feature is also its most confusing. An anchor (&base) labels a chunk of config; an alias (*base) reuses it elsewhere; a merge key (<<: *base) copies one mapping's keys into another. This is how teams avoid repeating the same database settings across staging and production:

defaults: &db
  timeout: 30
  retries: 3
production:
  <<: *db
  timeout: 60     # overrides only this key; retries: 3 is inherited

When a file grows to hundreds of lines, tracing which alias points where becomes genuinely hard. The anchor visualizer below the converter solves this: it lists every anchor with its definition line, its data type, a value preview, and clickable chips for every alias and every merge that references it. Click a chip and the cursor jumps to that exact line. If you are auditing an unfamiliar Helm chart or a sprawling CI config, this map pays for itself in minutes.

What the parser supports — the honest list

YamlForge implements a carefully chosen YAML subset rather than pretending to cover the entire specification. Supported: nested block mappings and sequences, plain/single-quoted/double-quoted scalars, nulls, booleans, integers, floats, hex and octal numbers, literal (|) and folded (>) block scalars with chomping, single-line flow collections, anchors, aliases, merge keys, multi-document streams, and comments. Deliberately unsupported: tab indentation, % directives, explicit type tags, multi-line plain scalars (put the value on one line or use |), and multi-line flow collections. The full list lives in the "Supported YAML subset" panel above, so you always know exactly what the tool promises.

Real-World Uses

Private by Design

Configuration files contain secrets: API keys, database passwords, internal hostnames. Uploading them to a random server for conversion is a risk you should never have to take. YamlForge performs every parse, validation, and conversion locally in your browser with JavaScript — there is no backend, no database, and no network request carrying your data anywhere. You can even disconnect from the internet after the page loads (aside from the ads) and keep converting. Your YAML never leaves your machine, full stop.

JSON to YAML Best Practices

A few habits make generated YAML safer: keep the YAML 1.1 boolean mode in mind when your data contains words like yes or on — the emitter quotes them for you, but knowing why saves confusion later. Prefer block style (the default here) over flow style for anything a human will edit. Use literal blocks for scripts, SQL, and certificates rather than escaped strings. And when a file holds several independent configs, embrace the multi-document stream with --- separators instead of inventing your own wrapper object — downstream YAML tools will thank you.

Whether you need a quick yaml to json converter for an API payload, a reliable json to yaml converter online for config authoring, or a strict yaml validator online that pinpoints errors to the exact character — YamlForge handles it in one free, unlimited, private page. Paste something above and see for yourself.

Frequently Asked Questions

Is YamlForge really free? Are there usage limits?
Yes — completely free with unlimited usage. No signup, no paywall, no watermark on your output, and no daily conversion cap. The tool runs entirely in your browser, so there is no server cost per conversion to pass on to you.
What is the difference between YAML and JSON?
JSON is a strict, machine-first format: curly braces, square brackets, double-quoted strings, no comments. YAML is a human-first format: indentation instead of braces, optional quotes, and full comment support. They represent the same data structures (objects, arrays, strings, numbers, booleans, null), which is why lossless conversion between them is possible — and why developers constantly need a yaml to json converter when moving config into code, or a json to yaml converter online when moving data back into config files.
Why does my YAML value "yes" become true when converted?
That is the YAML 1.1 specification: the unquoted words yes, no, on, off (and even y and n) are booleans, not strings. So "enabled: yes" parses as boolean true. YamlForge flags every occurrence with a warning showing the exact line and column, and offers a one-click "Quote all risky values" fix. Alternatively, switch the boolean mode to YAML 1.2, where these words are treated as plain strings.
How do multi-document YAML files work here?
Separate documents with a line containing --- (three dashes). YamlForge splits the stream and converts each document independently — nothing is silently dropped. The JSON output joins documents with --- separator lines, or you can choose "JSON array" mode to get a single array containing every document.
What are YAML anchors, aliases, and merge keys?
An anchor (&name) labels a piece of config so it can be reused; an alias (*name) inserts the anchored value elsewhere; a merge key (<<: *name) copies all keys of an anchored mapping into the current one. They eliminate repetition in large configs. YamlForge resolves all of them during conversion and shows an interactive visualizer mapping every anchor to its aliases and merges, with click-to-jump line navigation.
Is my data uploaded to a server when I convert?
No. All parsing, validation, and conversion happen locally in your browser using JavaScript. There is no backend, no database, and your YAML or JSON is never sent over the network. This makes the tool safe for configs containing API keys, passwords, or internal hostnames.