JSON
JSON ↔ YAML / CSV / XML / TOML
Convertire JSON in YAML, CSV, XML o TOML e viceversa — tutto nel browser, senza librerie.
Convenzione: gli attributi sono chiavi con "@" (@id → attributo id), il testo di un elemento misto è la chiave "#text", i figli ripetuti diventano 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.
Articolo su questo strumento: JSON ↔ YAML/CSV/XML/TOML: quando e perché convertire
Domande frequenti
In quali formati posso convertire un JSON con questo strumento?
Puoi convertire da e verso YAML, CSV, XML e TOML, interamente nel browser.
Perché la conversione in CSV a volte perde la struttura originale?
Il CSV è un formato piatto e tabellare, quindi non può rappresentare oggetti o array annidati senza prima appiattirli.
Come vengono gestiti gli attributi XML durante la conversione?
Per convenzione, le chiavi con prefisso "@" diventano attributi XML, mentre "#text" viene usato per il testo in contenuti misti.
Perché un numero o una stringa a volte cambia dopo la conversione in YAML?
Il parser YAML cerca di indovinare il tipo di un valore senza virgolette: "1.20" può diventare il numero 1.2 (perdendo lo zero finale), e "NO" può diventare il booleano false secondo le vecchie regole di YAML 1.1. Per evitarlo, i valori che devono restare stringhe vanno racchiusi esplicitamente tra virgolette.
Si può convertire nella direzione opposta senza perdite?
JSON ↔ YAML e JSON ↔ TOML sono di norma reversibili senza perdite, perché entrambi i formati supportano l'annidamento come JSON. JSON → CSV → JSON perde la struttura annidata, se presente — la conversione inversa restituirà solo la versione piatta dei dati.