Finance 55 tools → Seller Tools 17 tools → Date 19 tools → Health 28 tools → Everyday 25 tools → Math 22 tools → Construction 20 tools → PDF 25 tools → Education 11 tools → Conversion 7 tools → Text 14 tools → Image 22 tools → About → Contact →

Free YAML to JSON Converter

Conversion runs as you choose a direction. Your data never leaves this page - parsing happens entirely in your browser.

Runs entirely in your browser — your numbers are never sent anywhere.

Status
—

Result

Output

One converter for both directions, with errors that point at the line

YAML and JSON describe the same data in different clothes: config files, API payloads, Kubernetes manifests and CI pipelines constantly need translating between them. This converter runs both directions, formats JSON pretty (2 or 4 spaces) or minified, and — the part most online converters skip — reports YAML problems with the line number, because "invalid YAML" is not a diagnosis. It is powered by the js-yaml library, vendored on this site, and your input is parsed in your browser only.

YAML → data (js-yaml, safe schema) → JSON · or · JSON → data → YAML

Both directions go through the parsed data model, so what survives is the data, not the formatting: comments and YAML anchors do not exist in JSON and are not carried over.

Worked example

Press Load sample: a small YAML document describing this site — strings, a number, a boolean, a list and a nested map — converts to indented JSON with every value intact, and converting that JSON straight back returns equivalent YAML. Round-trip integrity is the test that matters, and it is the test this page is built around.

How to use this converter

  1. Paste your YAML (or JSON) into the input box, or press Load sample to see the shape of a conversion.
  2. Press YAML → JSON or JSON → YAML. The output appears in the Output box below the tool; the status line confirms validity or shows the error and its line.
  3. Choose pretty or minified JSON formatting before converting, if the JSON is headed for a file (pretty) or a payload (minified).
  4. Copy the output with the Copy button, or select and edit it directly in the output box.

What survives conversion — and what does not

Strings, numbers, booleans, null, arrays and nested objects all round-trip cleanly. Three things do not: comments (JSON has no comments), YAML anchors and aliases (expanded into plain data), and key order in JSON objects (preserved as written by JSON.parse in practice, but not something JSON guarantees). Dates in YAML become strings in JSON, because JSON has no date type — if a downstream tool expects a timestamp, that is a schema decision, not a conversion bug.

Frequently asked questions

Is my YAML or JSON uploaded anywhere?
No. The converter runs the js-yaml library — vendored on this site, not loaded from a CDN — entirely in your browser. Nothing is sent to a server, which is why it is safe for config files, .env-shaped data and API payloads you would not paste into a stranger's website. Close the tab and nothing remains.
Why does the error mention a line number?
Because js-yaml reports where parsing failed (its mark line), and this page shows it. YAML errors are overwhelmingly indentation problems — a stray tab (tabs are illegal as YAML indentation), a misaligned list item, or an unquoted colon inside a string. Start at the reported line and the line just above it.
What is lost when converting YAML to JSON?
Comments, anchors/aliases (they are expanded into the data they point at), and YAML's extra scalar types: dates and timestamps arrive as strings, and things like octal-looking numbers follow js-yaml's standard resolution. The data itself — strings, numbers, booleans, nulls, lists and maps — is preserved.
Can I convert JSON back to YAML?
Yes — the JSON → YAML button parses your JSON and dumps it as YAML with 2-space indentation. Long strings are wrapped at 120 columns. Converting YAML → JSON → YAML will not reproduce your original file byte-for-byte (formatting and comments change), but the data round-trips.
Which YAML features are supported?
js-yaml's default safe loading: block and flow styles, anchors and aliases, multi-line strings, merge keys and the standard core types. Custom tags and multi-document streams with exotic tags are outside the safe schema and will be reported as errors rather than evaluated — by design, because a converter page should never execute your file's code-shaped corners.
Keep going

Related text tools

Last updated: October 2026 · Published by CalcViso, a product of AllGuard IT

References & sources