Conversor JSON ↔ YAML
Convierte entre JSON y YAML en ambas direcciones con un solo clic.
Respuesta rápida: Conversor JSON ↔ YAML: convierte JSON a YAML y YAML a JSON con un solo clic. Funciona íntegramente en el navegador, gratis y sin registro.
Última actualización
Bueno saber
YAML is essentially a superset of JSON, so JSON → YAML always succeeds and is the direction most people want — turning a terse API payload into the readable, comment-friendly form that Kubernetes manifests, GitHub Actions workflows, and Docker Compose files use. The reverse, YAML → JSON, works for any YAML whose features JSON can represent.
Two YAML features have no JSON equivalent, so expect them to change. Comments are dropped entirely, because JSON has no comment syntax — keep a commented source of truth if the annotations matter. Anchors and aliases (&name / *name), which let YAML reference a block in multiple places, are expanded inline on conversion; the result is logically identical but has the shared block duplicated wherever it was referenced.
Number precision is a shared trap: both formats store numbers as IEEE-754 doubles, so integers above 2^53 (about 9 quadrillion) — think Twitter/Snowflake IDs — silently lose precision. If your data has huge integers, keep them as quoted strings in the source so they survive the round trip untouched.
Don't be alarmed if the YAML output looks reorganized: the emitter normalizes quoting and block style, adding quotes only where the spec requires them. The structure is unchanged even when the bytes differ. To simply tidy an existing YAML file without converting it, use the YAML formatter.
Preguntas frecuentes
- ¿Sobrevivirán mis comentarios al convertir de YAML → JSON?
- No — JSON no tiene sintaxis de comentarios. Los comentarios se eliminan silenciosamente.
- ¿Qué pasa con los anclajes y alias?
- Los expandimos al convertir a JSON, ya que JSON no puede expresar referencias. El resultado tiene una pequeña duplicación pero la misma estructura lógica.
- ¿Cómo maneja el convertidor números grandes?
- Ambos formatos utilizan dobles IEEE-754, por lo que los valores por encima de 2^53 pierden precisión. Si necesitas enteros grandes exactos, mantenlos como cadenas en tus datos de origen.
- ¿Mis archivos se subieron?
- No — ambas direcciones se ejecutan completamente en tu navegador.
- ¿Por qué mi salida YAML a veces es muy diferente de la entrada?
- Normalizamos — citando cadenas solo donde es necesario, eligiendo el estilo de bloque canónico, alfabetizando en algunos casos. La estructura es idéntica incluso si los bytes no lo son.