# Convert XML to JSON

Paste XML and get JSON back. Free, no signup, and nothing you paste is stored. The same conversion is available as an API call and to AI agents over MCP.

- Tool: [xml-to-json](https://setget.net/tools/xml-to-json.md)
- Endpoint: `POST https://setget.net/v1/tools/xml-to-json`
- Page: https://setget.net/convert/xml-to-json

## XML and JSON

- XML: XML marks data up with named tags and attributes. Feeds, office documents, SOAP services and many enterprise systems use it. It is wordy, and everything in it is text until a program decides otherwise.
- JSON: JSON is the data format of web APIs: nested objects, lists, text, numbers, true, false and null. It has no comments and is tiring to write by hand.

## What happens in this conversion

- What changes: Tags become keys, repeated tags become lists, and attributes are kept under keys that start with @ so they are not confused with child tags.
- Types: Everything in XML is text, so numbers arrive as text such as "42".
- Safety: Document type definitions and outside entities are refused, so a hostile file cannot make the converter read other files or expand without end.

## Questions

**Is my XML stored anywhere?** No. It is converted in memory and discarded. It is not saved or logged.

**How much XML can I convert at once?** Up to 1 MiB in a single request.

**Can a script or an AI agent convert XML to JSON?** Yes. Call POST https://setget.net/v1/tools/xml-to-json with JSON, or use the run_tool tool of the SetGet MCP server with slug "xml-to-json". The code samples on this page are ready to copy.
