Developer

Free YAML to JSON Converter

Convert YAML to JSON or JSON to YAML instantly in your browser.

Indent:

About this tool

YAML (YAML Ain't Markup Language) and JSON (JavaScript Object Notation) are both data serialization formats widely used in configuration files, APIs, and developer tooling. YAML is more human-readable with its indentation-based structure, while JSON is more universally supported across programming languages and APIs. This tool converts between YAML and JSON instantly in both directions. It is useful when you need to migrate Kubernetes manifests, Docker Compose files, or GitHub Actions workflows to JSON for API payloads, or when you receive JSON data and want to convert it to a more readable YAML format for configuration files. The converter uses js-yaml, a full-featured, spec-compliant YAML parser that handles all standard YAML features including anchors, aliases, multi-document streams, and complex nested structures. All processing happens in your browser - no data is sent to a server.

How to use

Step 1: Select YAML to JSON or JSON to YAML mode using the toggle.
Step 2: Paste your YAML or JSON into the left input box.
Step 3: Choose the indent size (2 or 4 spaces) for the output.
Step 4: Click Convert to transform the data.
Step 5: Click Copy to copy the result, or Swap to reverse the conversion.

Frequently Asked Questions

YAML uses indentation to define structure and supports comments, making it more readable for configuration files. JSON uses braces and brackets, has no comment support, but is more universally supported in APIs and programming languages. YAML is a superset of JSON.

Yes. Kubernetes manifests are standard YAML and convert perfectly. Paste your manifest YAML, select YAML to JSON mode, and click Convert. This is useful when working with APIs that require JSON payloads.

Yes. YAML supports comments starting with #. However, comments are not part of the data model and will be lost when converting to JSON, since JSON does not support comments.

YAML anchors (&name) mark a node for reuse, and aliases (*name) reference it. This allows you to define a value once and reuse it multiple times. This tool's parser (js-yaml) supports anchors and aliases.

Common YAML errors include incorrect indentation (YAML is indentation-sensitive), using tabs instead of spaces (YAML requires spaces), and special characters in values that need to be quoted. The error message will tell you the line number of the issue.

Related Tools