YAML to JSON Converter

Convert YAML to JSON in your browser: anchors resolved, comments dropped, valid JSON output. Nothing is uploaded. No upload, runs 100% in your browser

How to use this tool

  1. Paste or drop your input above.
  2. The tool processes it locally, usually instantly.
  3. Copy the output or download the result.

Two config languages, one converter

YAML is what humans write, Kubernetes manifests, CI pipelines, Docker Compose files, application configs. JSON is what machines consume, APIs, deployment templates, most tooling. This page converts between them in your browser: the YAML is parsed locally with js-yaml (the standard JavaScript implementation), turned into plain data, and serialized as formatted JSON.

What the conversion does to YAML features

Comments are dropped, because JSON has no comments. Anchors (&id) and aliases (*id) are resolved into their real values, the JSON contains the expanded data, not the references. Multi-line block scalars become single JSON strings with real newlines inside. Quoted strings like the ZIP code above stay strings; unquoted numbers become JSON numbers.

Errors are shown, not guessed

YAML is picky: tabs for indentation are invalid (spaces only), and a missing space after a colon fails parsing. When your input has such an error, the exact parser message is shown instead of a wrong result, fix the line it points at and re-convert.

Frequently Asked Questions

Are my files uploaded to a server?

No. Everything on this page runs inside your browser using JavaScript and WebAssembly. Your file never leaves your device, you can even disconnect from the internet after the page loads and the tool still works.

My YAML uses anchors and references, what happens to them?

They are resolved: every alias is replaced by the actual data it points to, so the JSON is a fully expanded document. JSON has no reference mechanism.

Can it convert a multi-document YAML file (--- separators)?

Not in one pass, the tool expects a single document. Split the file at the --- separators and convert each part separately.

Why did my number become a string (or vice versa)?

YAML decides by syntax: unquoted 9.99 is a number, quoted "10115" is a string. The JSON output preserves that distinction exactly.

Related Tools

XML FormatterLine CounterChinese Word CounterX/Twitter Character CounterJSON to YAMLCSV to JSONCSV to ExcelExcel to CSVXML to CSVCSV to XMLHTML Entity DecoderCase ConverterKebab Case ConverterJSON DiffDOCX to TXT