YAML to JSON Converter

Convert YAML to JSON and JSON to YAML

Paste YAML and get valid JSON instantly, or convert JSON back to YAML, with syntax validation and one-click copy — all in your browser.

YAML input
JSON output
The converted output will appear here.

About the yaml to json converter

YAML and JSON are both popular data-serialization formats. YAML's indentation-based syntax is favored for human-edited config files (CI pipelines, Kubernetes manifests), while JSON is the lingua franca of APIs and programmatic data exchange. Converting between them lets you use the same data in either context.

This tool uses the battle-tested js-yaml library to parse YAML safely and to dump JSON back to clean, indented YAML. Invalid input produces a clear error pointing to the problem, so you can fix typos fast.

Supported features

  • Nested maps and lists — arbitrary depth.
  • Scalars — strings, numbers, booleans, null, quoted strings.
  • Flow style — inline [a, b] and {k: v}.
  • Comments — preserved on input, stripped from output.

How to use the yaml to json converter

  1. Pick a direction

    Choose YAML → JSON or JSON → YAML.

  2. Paste your input

    Type or paste the YAML or JSON you want to convert.

  3. Read the output

    The converted result appears instantly, with any syntax error shown clearly.

  4. Copy or swap

    Copy the result, or switch direction to convert it straight back.

Frequently asked questions

Which YAML features are supported?
Nested maps, lists, scalars (strings, numbers, booleans, null), quoted strings, flow-style collections and comments are all handled via the js-yaml parser. Advanced features like anchors and multi-document streams may not round-trip perfectly.
Why did I get a syntax error?
YAML is whitespace-sensitive. A common cause is inconsistent indentation (tabs vs spaces) or a missing space after a colon. The error message includes the line number to help you locate the issue.
Can I convert JSON back to YAML?
Yes. Switch to JSON → YAML mode, paste valid JSON, and you get clean, indented YAML output.
Does the converter preserve key order?
Yes. Object key order is preserved in both directions, so your output matches the structure of your input.
Is my data sent to a server?
No. All parsing and conversion happen entirely in your browser.

I want to…

Common reasons people reach for the yaml to json converter — see if it matches your task.

  • Convert a YAML config file to JSON
  • Turn JSON into YAML for a config file
  • Validate and convert YAML syntax
  • Switch between YAML and JSON formats