YAML ↔ JSON Converter

Convert between YAML and JSON instantly — paste into either panel and convert. 100% browser-based, nothing sent to any server.

YAML Input
JSON Output
Input: 0 chars Output: 0 chars

How to Use

  1. Paste your YAML into the left panel (or JSON into the right panel).
  2. Click YAML → JSON to convert YAML to JSON, or JSON → YAML to go the other direction.
  3. Choose your preferred JSON indentation (2 spaces, 4 spaces, or tabs).
  4. Click Copy next to either panel to copy the content to your clipboard.
  5. Use the Swap button to exchange the left and right panel contents.

About This Tool

YAML (YAML Ain't Markup Language) and JSON (JavaScript Object Notation) are both widely used data serialization formats. YAML is popular for configuration files — Kubernetes manifests, Docker Compose files, CI/CD pipelines — while JSON is the standard for REST APIs and web data exchange. Converting between the two is a frequent task for developers working across different toolchains. This converter handles all standard YAML types including strings, numbers, booleans, nulls, nested objects, and arrays. The conversion runs entirely in your browser using a built-in YAML parser; no data is ever sent to a server.

Frequently Asked Questions

Does YAML support everything JSON supports?

Yes — JSON is technically a subset of YAML 1.2. Every valid JSON document is also valid YAML. YAML additionally supports comments, multi-line strings, anchors and aliases, and more flexible quoting rules. When converting YAML to JSON, comments are discarded since JSON has no comment syntax.

Why does my YAML number become a string in JSON?

YAML infers types automatically: port: 8080 becomes the number 8080, while port: "8080" becomes the string "8080". Version strings like 1.0 can be ambiguous — quote them in YAML ('1.0') to ensure they stay as strings in the JSON output.

Can I convert multi-document YAML files?

Multi-document YAML files (separated by ---) are not directly representable as a single JSON object. This tool converts the first document only. Split your file manually and convert each document separately if needed.

Related Tools