Convert YAML to JSON Online — Free, Local, Instant
Paste YAML and get JSON (or vice versa) instantly. All conversion happens in your browser — your data never leaves your device.
YAML / JSON 互转
Why convert YAML to JSON?
- API compatibility — many REST APIs and serverless platforms accept only JSON. Converting your YAML config lets you POST it directly.
- Tool integration — tools like jq, JSONPath validators, and schema validators work exclusively with JSON.
- Data exchange — JSON is the lingua franca of web services. Converting YAML configs to JSON makes them consumable by any system.
- Debugging — JSON's stricter syntax (quoted keys, no anchors) can help surface structural issues hidden by YAML's flexibility.
What's preserved vs lost in conversion
Preserved
- All data values and types
- Nested structure (mappings, sequences)
- Anchor and alias references (expanded inline)
- Multi-document separators (converted to JSON arrays)
Lost
- Comments (JSON has no comment syntax)
- Original formatting and indentation
- YAML-specific tags (e.g., !!str, !!int)
- Document start/end markers (---)
How to convert YAML to JSON with YAML Shuttle
- Paste your YAML into the input box at the top of this page.
- Click “YAML → JSON”. YAML Shuttle parses the YAML and re-emits it as valid JSON.
- Copy the JSON from the output area. The result is RFC 8259-compliant JSON with 2-space indentation.
Need to go the other direction? Click “JSON → YAML” to convert JSON input into YAML format.
Common conversion edge cases
- Anchors and aliases
- YAML anchors (
&default) and aliases (*default) are resolved during conversion. The referenced value is duplicated at each alias point in the JSON output. - Multi-document YAML
- YAML files with
---separators are treated as multiple documents. YAML Shuttle converts each document and wraps them in a JSON array. - YAML-specific types
- YAML tags like
!!str,!!int, and!!floatare stripped. Values are converted to their JSON equivalents (string, number, boolean, null). - Unicode and special characters
- Unicode characters are preserved as-is in the JSON output. Special characters that require escaping in JSON strings (quotes, backslashes) are properly escaped.
Frequently Asked Questions
- Is the YAML to JSON converter free?
- Yes. YAML Shuttle's converter is completely free with no signup or ads. The entire tool runs in your browser.
- Does the converter send my data to a server?
- No. Conversion happens entirely client-side using the eemeli/yaml v2 library (npm package `yaml`). Your data never reaches our servers, making it safe for Kubernetes configs, API credentials, and other sensitive files.
- What happens to YAML comments during conversion?
- Comments are dropped during YAML → JSON conversion because the JSON specification (RFC 8259) does not support comments. The data structure and values are preserved exactly.
- Does it support YAML anchors and aliases?
- Yes. YAML anchors (&) and aliases (*) are resolved during conversion. The referenced values are expanded inline in the JSON output.
- Can I convert JSON back to YAML?
- Yes. Click the 'JSON → YAML' button to convert JSON input to YAML format. The output uses 2-space indentation by default.
Related YAML tools
- YAML Validator — check if your YAML is well-formed
- YAML Formatter — beautify or minify YAML
- YAML Escape / Unescape — escape strings for embedding inside YAML
- About YAML Shuttle — privacy, use cases, full FAQ