YAML to JSON Converter

Convert YAML to JSON online.

input.yaml
output.json

About YAML to JSON

Convert YAML - config files, CI pipelines, Kubernetes manifests - into JSON you can feed to APIs and tools.

🛠️
How to use it
  1. Paste your YAML into input.yaml, or click Load Sample.
  2. Click Convert.
  3. The JSON appears in output.json; format or copy it from the editor header.
  4. If the YAML is invalid, the error shows the line and column to fix.
💡
Tips & use cases
  • Comments and anchors are YAML-only: comments are dropped and anchors are expanded in the JSON output.
  • Unquoted values like 08, 1e3 or 2026-09-25 convert to numbers or dates - quote them to keep strings.
  • Going the other way? Use JSON to YAML.

Convert YAML to JSON Online

Paste YAML and get equivalent JSON: mappings become objects, sequences become arrays and scalars keep their type. Handy when a tool or API needs JSON but your config lives in YAML.

📐

How YAML maps to JSON

  • Mappings and sequences: key: value blocks become objects and - item lists become arrays, in the same order.
  • Scalars: numbers, true/false and null keep their type; everything else becomes a string.
  • Comments: JSON has no comments, so # comments are removed.
  • Anchors and aliases: &anchor and *alias references are expanded, so the repeated content appears in full.
📦

Common reasons to convert YAML to JSON

  • Sending a Kubernetes manifest to an API that expects JSON
  • Turning an OpenAPI or Swagger YAML file into JSON for tooling
  • Debugging CI/CD configuration by viewing its real structure
  • Processing YAML config with JSON tools such as jq

YAML to JSON FAQ

What happens to comments in my YAML?

They are dropped. JSON has no comment syntax, so there is nowhere to keep them.

Can I convert a file with several documents separated by ---?

Not in one go. The converter expects a single YAML document and reports an error if it finds more. Convert each document separately.

Why did my date turn into a long timestamp?

An unquoted date such as 2026-09-25 is a timestamp in YAML, and it is written to JSON in ISO format, like "2026-09-25T00:00:00.000Z". Put the value in quotes in the YAML to keep it as plain text.

Is my data uploaded to a server?

No. The conversion runs entirely in your browser.