Lintify Logo
Lintify
Converters

YAML to JSON Converter

Convert any YAML document back to JSON. Supports YAML 1.1 and 1.2, anchors, aliases, and multi-document files.

YAML input
1
JSON
Output will appear here…

Convert YAML configs back into JSON

YAML is great for writing config files by hand, but it has quirks that bite you when you need to consume those files programmatically. The boolean coercion rules (yes,no, on, off all become booleans in YAML 1.1) and the strict indentation rules make YAML error-prone in automated pipelines. JSON is simpler — strict, predictable, supported everywhere — and is often a better choice for machine-to-machine communication.

The converter uses js-yaml to parse your YAML and then serializes the result as JSON. It supports YAML 1.1 (the version most tools use), resolves anchors and aliases, and handles multi-document files by producing a JSON array with one object per document. The output is indented for readability and can be downloaded as a JSON file.

Anchors and aliases are resolved

YAML supports anchors (&anchor) and aliases (*anchor) as a way to reuse a value multiple times in the same document. Lintify resolves these during parsing — the alias is replaced by the anchored value in the resulting JSON. The anchors themselves disappear because JSON has no equivalent feature. If you need to preserve them, you have to keep the file in YAML.

Multi-document YAML files

YAML supports multiple documents in a single file, separated by ---. This is the standard format for Kubernetes manifests, where a single file can define multiple resources. Lintify converts a multi-document YAML file into a JSON array of objects — one object per document. The order is preserved.

Common YAML pitfalls

The most common YAML pitfalls are: inconsistent indentation (YAML is strict about spaces versus tabs), missing spaces after colons (key:value is invalid; it must be key: value), unquoted strings that happen to look like numbers or booleans, and tabs used for indentation (forbidden by the spec). The parser reports the line number of the error, which usually points at the problem.

Frequently asked questions

Common questions about the YAML → JSON tool.

Which YAML version is supported?
Lintify uses js-yaml, which implements YAML 1.1 with selected YAML 1.2 features. This is the same engine that powers most JavaScript-based YAML tooling (Webpack, Eleventy, GitHub Actions runners). It is a safe default for almost every config file you will encounter.
What happens to YAML anchors and aliases?
Anchors (&) and aliases (*) are resolved during parsing — the alias is replaced by the anchored value in the resulting JSON. The anchors themselves disappear because JSON has no equivalent feature. If you need to preserve them, you have to keep the file in YAML.
Can I convert a multi-document YAML file?
Yes. A multi-document YAML file (separated by ---) becomes a JSON array of objects, one per document. This is the standard convention and works well with tools like kubectl that emit multiple YAML documents in a single stream.
Why are my YAML booleans turning into strings?
YAML 1.1 treats yes, no, on, off, true, false and a handful of other words as booleans. YAML 1.2 narrows this to just true and false. If your file was written for YAML 1.1 and you convert it with a YAML 1.2 parser, the booleans may become strings. Lintify uses YAML 1.1 semantics for compatibility, so the round-trip should preserve the type.
Why does my YAML fail to parse?
The most common cause is inconsistent indentation — YAML is strict about spaces and tabs. Other common issues are tabs used for indentation (forbidden by the spec), missing spaces after colons (key:value is invalid, it must be key: value), and unquoted strings that happen to look like numbers or booleans. The error message from the parser tells you the line number to inspect.

Related tools