JSON YAML Converter
Two-way JSON and YAML conversion with nested structure support
Notes
Supports nested objects, arrays, strings, numbers, booleans, and null. YAML indentation must be spaces (never tabs); object keys need no quotes, but strings with special characters should be quoted.
How to Use
JSON and YAML are both common formats for configuration and data exchange: JSON powers APIs and frontends, while YAML is heavily used in Kubernetes, Docker Compose, and CI/CD configs. This tool uses js-yaml to convert either way.
How to use: paste JSON or YAML into the input and click "JSON → YAML" or "YAML → JSON". YAML indentation must be spaces (never tabs); object keys do not need quotes, but strings with special characters should be quoted.
FAQ
Why do types change when converting YAML to JSON?
YAML is loosely typed; unquoted scalars are auto-detected as strings, numbers, booleans, or null. For example, hello becomes a string, while true becomes a boolean. Quote a value to force it to remain a string.
Can YAML use Tab for indentation?
No. The YAML spec forbids Tab as an indentation character; spaces are required. JSON-to-YAML output uses 2-space indentation, and your YAML input must use spaces too.
Will conversion lose data?
JSON and YAML are equivalent on basic types, so conversion does not lose data. Some advanced YAML features (multi-document, anchors/aliases, flow style) may be expanded or simplified when going back to JSON; JSON to YAML and back to JSON is generally a round trip.