# Convertitore da XML a JSON

> Converti elementi e attributi XML in JSON.

[Open tool](https://www.toolcabana.com/it/xml-to-json) · [Sviluppo e dati](https://www.toolcabana.com/it/category/developer-and-data)

Tool ID: xml-to-json. Requested language: it. Description language: it. Complete guide translation: yes.

## Overview (en)

XML to JSON converts well-formed XML into formatted JSON that keeps both elements and attributes. Attributes appear as keys prefixed with @_, repeated sibling elements become arrays, and element text that looks like a number is converted to a number. Invalid XML is reported with a line number, and DOCTYPE or entity declarations are refused.

## Supported tasks (it)

Converti elementi e attributi XML in JSON.

## Steps (it)

1. Incolla l'origine nell'editor di input, oppure carica l'esempio integrato.
2. Controlla il formato di origine prima di eseguire l'operazione.
3. Esegui il convertitore da XML a JSON, esamina il risultato, poi usa i controlli disponibili per copiare o scaricare.

## Settings

No additional settings.

## Limitations (it)

Le operazioni di testo accettano in genere fino a 2.000.000 di caratteri. Parser, generatori e formule singoli applicano limiti aggiuntivi mostrati dai relativi controlli.

## Example input

```text
<root><name>ToolCabana</name><count>2</count></root>
```

## Privacy and connections (it)

Questa operazione elabora i dati di origine nel tuo browser. Copia e download sono azioni esplicite; l'input di origine non viene salvato in un account né in una cronologia.

## Questions (it)

### How are XML attributes shown in JSON?

Attributes are kept and appear on their element object as keys starting with @_, so id="1" becomes "@_id": "1". Attribute values stay strings.

### What happens to repeated XML elements when converting to JSON?

Sibling elements with the same name are grouped into a JSON array under that name. A single occurrence stays a plain value or object.

### Why did XML to JSON remove leading zeros?

Element text that looks like a number is parsed as a JSON number, so a value such as 007 becomes 7. Keep codes as attributes if their exact text matters.

### Dove viene elaborato il mio input?

Questa operazione elabora i dati di origine nel tuo browser. Copia e download sono azioni esplicite; l'input di origine non viene salvato in un account né in una cronologia.

### Quali sono i limiti di input?

Le operazioni di testo accettano in genere fino a 2.000.000 di caratteri. Parser, generatori e formule singoli applicano limiti aggiuntivi mostrati dai relativi controlli.

## Related tools

- [YAML to JSON](https://www.toolcabana.com/it/yaml-to-json)
- [JSON to YAML](https://www.toolcabana.com/it/json-to-yaml)
- [CSV to JSON](https://www.toolcabana.com/it/csv-to-json)
- [JSON to CSV](https://www.toolcabana.com/it/json-to-csv)
