JSON
JSON ↔ YAML / CSV / XML / TOML
Convertir JSON a YAML, CSV, XML o TOML y viceversa — todo en el navegador, sin bibliotecas.
Convención: los atributos son claves con "@" (@id → atributo id), el texto de un elemento mixto es la clave "#text", los hijos repetidos son un array.
JSON, YAML, CSV, XML, and TOML all solve the same problem — structured data representation — with different syntax and different trade-offs. This tool converts between all of them in both directions, right in your browser.
How to use it
- Paste data in the source format and pick a target format — the conversion happens instantly.
- For CSV, the first row is automatically treated as column headers.
- Copy the result or download it as a file with the matching extension.
Common uses
- Converting an app's configuration from YAML to JSON (or back) to match a specific framework.
- Turning a spreadsheet export (CSV) into JSON for loading into a database or API.
- Reading a TOML config (common in the Rust/Python ecosystem) in the more familiar JSON format.
Things to keep in mind
JSON ↔ YAML and JSON ↔ TOML are usually lossless in both directions, since both formats support nesting the same way JSON does.
JSON → CSV loses nested structure: CSV is a flat tabular format, so nested objects and arrays either need to be flattened into separate columns or serialized as text.
Artículo sobre esta herramienta: JSON ↔ YAML/CSV/XML/TOML: cuándo y por qué convertir
Preguntas frecuentes
¿Convertir JSON a CSV siempre funciona sin problemas?
Solo para datos razonablemente planos y tabulares. Los objetos profundamente anidados o arrays con formas variables no se mapean limpiamente a las filas y columnas planas de CSV, así que los valores anidados suelen aplanarse o convertirse en cadenas de texto.
¿Qué sucede con los tipos de datos al convertir a YAML o TOML?
El conversor conserva los tipos donde el formato de destino los admite (números, booleanos, null), pero formatos como XML representan todo como texto a menos que agregues tú mismo atributos de tipo explícitos.
¿Mis datos se suben a algún sitio durante la conversión?
No. Toda la conversión ocurre localmente en tu navegador — nada se envía a un servidor.
¿Por qué a veces cambia un número o una cadena al convertir a YAML?
El analizador de YAML intenta adivinar el tipo de un valor sin comillas: "1.20" puede convertirse en el número 1.2 (perdiendo el cero final), y "NO" puede convertirse en el booleano false según las reglas antiguas de YAML 1.1. Para evitarlo, los valores que deben seguir siendo texto conviene ponerlos explícitamente entre comillas.
¿Se puede convertir en sentido inverso sin pérdidas?
JSON ↔ YAML y JSON ↔ TOML suelen ser reversibles sin pérdidas, porque ambos formatos admiten el anidamiento igual que JSON. JSON → CSV → JSON pierde la estructura anidada si la había — la conversión inversa solo devolverá la versión plana de los datos.