Skip to content
TConverter

YAML ⇄ JSON Converter

In browser

Convert YAML to JSON and JSON to YAML instantly. Runs entirely in your browser.

YAML → JSON

About the YAML to JSON converter

The TConverter YAML ⇄ JSON converter turns YAML into formatted JSON and JSON back into YAML in both directions on a single page. YAML is the format of choice for configuration files such as Docker Compose, Kubernetes manifests, GitHub Actions workflows and many application settings, while JSON is what most APIs, scripts and programming languages expect. Moving data between the two by hand is slow and error-prone, especially when indentation decides the structure.

Typical uses include checking how a Kubernetes or Compose file is actually interpreted, feeding a YAML config into a tool that only accepts JSON, turning an API response into a readable YAML snippet for documentation, or quickly spotting an indentation mistake. When the YAML cannot be parsed, the error message includes the line and column reported by the parser, so you can find the problem without guessing.

The converter uses the YAML 1.2 core schema with support for the merge key, so common patterns like '<<: *base' in Docker Compose files resolve the way you expect. Unlike older YAML 1.1 parsers, values such as yes, no, on and off stay as strings instead of silently becoming booleans, which avoids the well-known problem where a country code like NO turns into false. Unsafe types such as JavaScript functions cannot be created from the input. If a file contains several documents separated by ---, the result is a JSON array with one element per document, and empty input becomes null.

In the other direction, JSON is validated first and then written as YAML with two-space indentation. Keep in mind that JSON has no comments, so YAML comments are not carried over when you convert to JSON and back. Anchors and aliases are expanded into full copies in the JSON output; to protect your browser tab from so-called alias bombs, conversion stops if the expanded result would exceed one million values, a limit that real configuration files stay far below.

Everything runs locally in your browser. Your configuration, which may contain hostnames, credentials or internal settings, is never uploaded to a server. The tool is free to use and does not require an account.

Frequently asked questions

Is the YAML to JSON converter free?

Yes. TConverter is free to use and does not require sign-up or an account.

Is my YAML or JSON sent to a server?

No. Parsing and conversion happen entirely in your browser, so your data never leaves your device.

Does it support YAML anchors, aliases and merge keys?

Yes. Anchors (&name), aliases (*name) and the merge key (<<) are supported. In the JSON output, aliases are expanded into full copies of the referenced data.

What happens with multiple YAML documents in one file?

Documents separated by --- are converted into a JSON array, with one array element per document. A single document is converted to a single JSON value.

Why do yes and no stay as strings?

The converter follows the YAML 1.2 core schema, where only true and false are booleans. This prevents values like yes, no, on or off from being silently changed to booleans as older YAML 1.1 parsers do.

Are YAML comments preserved?

No. JSON has no comment syntax, so comments are dropped when converting YAML to JSON. Converting the JSON back to YAML will not restore them.