Convertir JSON to YAML and back without losing data
Translate entre JSON y YAML para config archivos, preserving nested estructuras, arreglos, y scalar tipos across el round-trip.
- 1
YAML is a superset of JSON with indentation-based structure and fewer brackets — preferred for human-edited config. Converting JSON→YAML makes config readable; YAML→JSON makes it machine-parseable. The conversion must preserve types, nesting, and arrays.
- 2 Conversor JSON ↔ YAML →
Paste JSON. The tool outputs equivalent YAML with 2-space indentation, block style for maps and sequences, and proper quoting only where needed.
- 3 json-format → json-yaml
Use the chain to convert JSON→YAML and immediately validate the YAML parses back to the same structure.
- 4 yaml-convert
Invertir direction: paste YAML, get JSON. Useful when a tool expects JSON input but your source is a YAML config.
- 5
Watch for YAML-specific gotchas: unquoted strings that look like booleans (yes/no/on/off), numbers with leading zeros (interpreted as octal in YAML 1.1), and multi-line string folding. Quote ambiguous scalars to be safe.
Preguntas frecuentes
- Why does my YAML have quotes around some strings but not others?
- YAML quotes strings that would otherwise be misinterpreted — e.g. 'true' (would be boolean), '123' (would be number), strings with special characters. The converter adds quotes only where necessary to preserve the JSON type.
- Can all JSON be converted to YAML?
- Yes — YAML is a superset of JSON, so every valid JSON document is also valid YAML. The reverse is not true: YAML features like anchors, multi-document streams, and tags have no JSON equivalent and may be lost or rejected.