← Hashito System Home 日本語 Tools Blog
Convert
Supported notation
Maps (keys and values), lists, nesting, multi-line strings (| and >), anchors (&) with aliases (*), and skipping comments are supported. Comments are not preserved when converting YAML to JSON, because JSON has no comment syntax.

About converting YAML and JSON

How to use

Paste YAML into the left input and press "YAML → JSON" to get JSON on the right, or paste JSON into the right input and press "JSON → YAML" to get YAML on the left. It is handy when you want to work with configuration files such as Kubernetes manifests, GitHub Actions workflows, or Docker Compose files as JSON, or the other way around.

What is kept and what is lost

The data structure and values are preserved as they are. However, presentation details of YAML such as comments, anchor names, and whether strings are quoted do not exist in JSON, so they are lost in conversion. Anchors and aliases are expanded into the actual referenced values.

Common syntax errors

In YAML, common mistakes are uneven indentation (tabs are not allowed), a missing space after a colon (key:value is wrong; key: value is correct), and a missing space after a list hyphen. When an error appears, check around the reported line number.

Frequently asked questions (FAQ)

Which YAML features are supported?

The conversion uses js-yaml, a proven library that follows YAML 1.2. It can read the notation commonly used in configuration files, including maps, lists, nesting, multi-line strings, and anchors with aliases. Special YAML that relies on custom tags is out of scope.

How are syntax errors shown?

When the YAML syntax is invalid, the error message is shown together with the line number and character position. This helps you locate common mistakes such as uneven indentation or a missing space after a colon. Errors on the JSON side also show an error message.

Is the data I enter sent to a server?

No. The conversion runs entirely in JavaScript within your browser. The YAML and JSON you enter are never sent to or stored on any server.