Free tool · Runs in your browser

YAML to JSON Converter

Paste YAML and get clean, formatted JSON instantly - side by side, with syntax highlighting, indent control, key sorting, and multi-document support. Conversion runs entirely in your browser; nothing is uploaded.

Conversion runs entirely in your browser - your YAML is never uploaded. Safe for configs, secrets, and manifests.

Try:
YAML input
JSON output
JSON appears here as you type.

What this converter does

YAML and JSON describe the same thing - maps, lists, and scalars - so any valid YAML document has an exact JSON equivalent. This tool parses your YAML with a real YAML engine (not a regex), builds the underlying data structure, and serializes it back out as JSON with the formatting you choose. Because JSON is a subset of YAML, valid JSON also passes straight through unchanged.

Everything happens client-side as you type, so it stays fast and private. You control the indentation (2 or 4 spaces, tabs, or fully minified), can sort keys alphabetically for clean diffs, and can copy or download the result in one click.

Multi-document YAML becomes a JSON array

A single YAML file can hold several documents separated by --- - this is how Kubernetes manifests and other configs pack a Namespace, a ConfigMap, and a Deployment into one file. JSON has no equivalent separator, so when the tool sees more than one document it wraps them in a JSON array, preserving order. A single document converts to a single JSON object or value, not a one-element array.

Things that do not survive the trip

JSON is simpler than YAML, so a few YAML-only features are resolved or dropped. Comments have no place in JSON and are removed. Anchors and aliases ( &name / *name ) are expanded to their actual values, so the JSON is fully self-contained. Special YAML scalars are normalized to JSON-safe values, and non-standard tags are rejected rather than guessed at.

If the parser hits a problem - a bad indent, a tab where spaces belong, a duplicate key - you get the exact line and column and the offending line is highlighted, so you can fix it without hunting.

Is it safe to paste config here?

Yes. The conversion runs 100% in your browser with no network calls - you can confirm it with the browser's network tab open, and it keeps working offline. Nothing you paste, upload, or generate leaves the page, which is why it is fine for real manifests, environment files, and CI configs.

YAML vs JSON at a glance

FeatureYAMLJSON
CommentsYes ( # ... )No
Multiple documentsYes ( --- separators )No (one root value)
Anchors & referencesYes ( & and * )No
Trailing commasN/ANot allowed
Human readabilityHigh (indentation)Medium (braces)
Machine parsingWidely supportedNative everywhere
YAML & JSON FAQ

Frequently asked questions

Paste your YAML into the left pane. The formatted JSON appears live in the right pane as you type - no button to press. Choose your indentation, optionally sort keys, then copy or download the JSON. Everything runs in your browser.
Yes. JSON is a strict subset of YAML, so any valid JSON is also valid YAML and passes through this converter unchanged. The reverse is not true: YAML has comments, anchors, and multiple documents that plain JSON cannot express.
YAML files can contain several documents separated by --- (common in Kubernetes manifests). Since JSON has no document separator, the tool outputs a JSON array with one element per document, in order. A single document converts to a single object or value.
JSON has no comments, so YAML comments are dropped. Anchors and aliases (&name and *name) are expanded to their real values, producing self-contained JSON. Non-standard YAML tags are rejected rather than silently guessed, keeping the output safe.
The most common causes are inconsistent indentation, using tabs instead of spaces, a missing space after a colon, or a duplicate key. The tool shows the exact line and column of the error and highlights the offending line so you can fix it quickly.
Yes. The converter runs entirely client-side with no uploads or network calls, which you can verify in the browser network tab, and it works offline. Your YAML never leaves your machine, so it is safe for manifests, .env files, and secrets.
Yes. Pick 2-space, 4-space, or tab indentation, or minify to a single line. You can also sort object keys alphabetically, which makes two configs easy to diff. Copy the result to your clipboard or download it as output.json.
Configs live on servers

Ship the config, manage the servers.

CtrlOps is a modern SSH workspace for the machines your YAML deploys to - organized hosts, secure key management, and instant terminals. Convert the config here, apply it on the server in one click.

Start instantly· No credit card· No sneaky autorenewals