YAML to JSON Converter
Convert YAML to JSON and JSON to YAML instantly. Supports nested objects, arrays, multi-line strings. Free, browser-based, no server required.
How to Use
- To convert YAML → JSON: paste your YAML into the left panel and click YAML → JSON.
- To convert JSON → YAML: paste your JSON into the right panel and click JSON → YAML.
- Use Ctrl+Enter (or Cmd+Enter on Mac) as a keyboard shortcut to convert from whichever panel you’re typing in.
- Click Copy on either panel to copy the result to your clipboard.
Worked Examples
Simple object
Input YAML:
name: Alice
age: 30
active: true
Output JSON contains name, age, and active fields.
Nested structure with arrays
Input YAML:
server:
host: localhost
port: 8080
features:
- auth
- logging
- cache
Output JSON contains nested server object with features array.
Round-trip conversion
Paste the JSON output back into the right panel and click JSON → YAML to round-trip your data. Note that YAML comments and formatting preferences are not preserved in round-trips.
YAML vs JSON
YAML (YAML Ain’t Markup Language) is a human-friendly data serialization format popular for configuration files (Docker Compose, Kubernetes, Ansible, GitHub Actions). JSON (JavaScript Object Notation) is the most widely used data interchange format for APIs and web services. Both can represent the same data structures — this tool converts between them losslessly (except for YAML-only features like comments and anchors).
FAQ
What YAML features are supported?
All standard YAML 1.2 features including nested objects, arrays, multi-line strings (literal and folded), anchors, aliases, and all scalar types (strings, numbers, booleans, null, dates).
Can I convert multi-document YAML?
This tool converts single YAML documents. If your input contains multiple documents separated by ---, only the first document will be converted.
How are YAML data types mapped to JSON?
YAML strings become JSON strings, numbers stay numbers, booleans become true/false, null becomes null, dates become ISO strings, and sequences/mappings become arrays/objects.
Is my data sent anywhere?
No. All conversion runs 100% in your browser using JavaScript. Your data never leaves your machine.