Conversor de JSON a YAML gratuito
El conversor de JSON a YAML convierte JSON en YAML legible: práctico para archivos de configuración y manifiestos de Kubernetes/CI. Admite objetos anidados, arrays y escalares.
The reverse is the YAML to JSON Converter, and the result should be checked with the YAML Validator. To inspect the source structure before converting, the JSON Formatter & Beautifier is the tool.
Cómo usar JSON a YAML
- 1 Paste your JSON.
- 2 Convert. Nested objects become indented blocks and arrays become list items.
- 3 Check the indentation width, since it is configurable and affects readability.
- 4 Copy the YAML and add comments where they help.
Cómo usarlo
Pega JSON y haz clic en Convertir. La salida YAML aparece a la derecha.
- Los objetos anidados se convierten en claves indentadas
- Los arrays se convierten en listas "- " (incluidas listas de objetos)
- Las cadenas con caracteres especiales se entrecomillan
Subconjunto admitido
Produce el subconjunto YAML común. Se admiten estructuras muy grandes o profundamente anidadas, pero no se emiten funciones YAML exóticas.
Preguntas frecuentes
Why would I convert JSON to YAML?
Because YAML is more pleasant to maintain by hand. Configuration that a person edits regularly — deployment manifests, CI definitions, application settings — reads considerably better as YAML, with less punctuation and the ability to carry explanatory comments. JSON has no comment syntax at all.
Are there values that cannot be represented?
JSON strings that look like other YAML types need quoting, and a converter that is not careful can produce a file that means something different from what it says. A string containing `yes`, `null` or `1.0` is quoted to keep it a string. Numbers and booleans pass through unchanged, and `null` becomes YAML's own null form.
Which indentation width is correct?
Two spaces is the convention and what almost every tool assumes. Four is valid but unusual and generates noisy diffs when mixed into a codebase that uses two. Whichever you choose, apply it consistently across a repository, because YAML's reliance on indentation makes inconsistency a source of parsing errors.
Herramientas para desarrolladores relacionadas
También te puede interesar
Herramientas de otras categorías que suelen combinarse con JSON a YAML: