YAML to JSON Converter

YAML Input

JSON Output

How this YAML to JSON converter works

Paste any YAML configuration — Kubernetes manifests, Docker Compose files, OpenAPI specs, or Spring Boot application.yml — on the left, and the tool validates and converts it into 2-space indented JSON on the right. Everything runs 100% client-side in your browser, so private config files never leave your machine. Need the reverse? Switch to the JSON to YAML Converter.

YAML to JSON conversion reference

YAML Feature JSON Output Notes
Indented key: value {"key": "value"} Keys are always emitted as double-quoted strings
Block sequence - item ["item"] Nested lists and lists of objects are preserved
Comments # ... Stripped Standard JSON does not support comments
Anchors &ref & aliases *ref Expanded inline Reused YAML blocks are materialized into plain JSON values
Literal | & folded > blocks Single JSON string with \n Preserves or folds newlines per YAML block scalar rules
Empty value (key:) or ~ {"key": null} Maps directly to JSON null

Common YAML pitfalls caught during conversion

  • Tabs instead of spaces: YAML strictly forbids tab indentation and throws a parse error with the exact line number. Replace tabs with 2 spaces.
  • Unquoted colons in values: A value like message: error: timeout fails to parse because YAML sees a second mapping colon. Wrap the value in quotes (message: "error: timeout").
  • Comments disappear in JSON: Because JSON has no comment syntax, # comments in YAML are discarded during conversion — keep your YAML source if you rely on inline documentation.
  • Multi-document YAML (---): A single JSON output expects one root value. If your Kubernetes file contains multiple manifests separated by ---, convert one document at a time.

FAQs

Does this YAML to JSON converter upload my file anywhere? No. Parsing runs entirely inside your browser via JavaScript (js-yaml), so the YAML you paste never leaves your browser. The page only records anonymous usage events (such as a conversion or a copy click), never the content.
Does it support YAML anchors (&) and merge keys («)? Yes. Standard YAML anchors (&defaults) and aliases (*defaults) are automatically dereferenced and expanded into valid JSON objects.
Why did my unquoted date or timestamp change format? YAML parsers recognize ISO-8601 dates (like 2026-11-26) as Date objects and serialize them into full ISO timestamp strings in JSON ("2026-11-26T00:00:00.000Z"). Quote the date ("2026-11-26") in YAML if you want a plain string.
Can I convert YAML directly to Java .properties instead? Yes — use the YAML to Property Converter to flatten nested YAML keys directly into Spring Boot application.properties dot notation.

More Free Developer Tools