# XML to JSON converter: run it free, or from your agent

Converts XML to JSON and JSON to XML, with attribute prefix, text key, typed values and always-array options.

## Prompt

Use looot to turn an XML feed into rows. 1. Set up https://looot.ai/skill.md. 2. Search the catalog for an endpoint that fetches a URL's raw content and check its price before you call. 3. Fetch [RSS or sitemap URL]. 4. Convert the XML to JSON with attributes prefixed by @. 5. Return a CSV with one row per item: title, link and date.

## What it needs

An XML document or a JSON value

## What comes back

- JSON with attributes and text
- XML with attributes and repeated elements
- line and column of a parse error

## Endpoints and providers

None. The tool on the web page runs in the browser and calls no endpoint.

## What it costs

Nothing. The tool on the web page runs in the visitor's browser: no account, no API call and no limit per hour. The prompt above runs the same job from your own looot account with current data, billed per call.

## Read RSS and sitemaps

Turn a feed or a sitemap into JSON you can loop over.

## Modernise SOAP

Convert a SOAP or legacy XML response into JSON for a newer service.

## Feed an agent

Give an agent JSON instead of XML, which it reads with fewer mistakes.

## Build test fixtures

Write a fixture in JSON and convert it to the XML an old API expects.

## How are XML attributes converted?

Each attribute becomes a key with a prefix, @ by default, so <book id="7"> gives { "@id": "7" }. Change the prefix, or drop attributes when you do not need them.

## What happens to repeated elements?

Two or more children with the same name become an array. A child that appears once stays a single value, unless you turn on Always arrays, which makes every element a list so the shape does not change with the data.

## Where does element text go when it also has attributes?

Under the text key, #text by default. An element with only text becomes a plain string.

## Are numbers and booleans converted?

Only when you turn on Numbers and booleans. By default every value stays a string, because XML has no types and a zip code such as 02134 must keep its leading zero.

## Can it convert JSON to XML?

Yes. Switch the direction. Keys with the attribute prefix become attributes, the text key becomes element text and arrays become repeated elements. A value with several top level keys is wrapped in a root element.

## Are namespaces and comments kept?

Namespace prefixes stay part of the name, such as soap:Body, and xmlns declarations become attributes. Comments and processing instructions are dropped.

## Is it safe to paste untrusted XML?

Yes. The parser never loads external entities or DTDs, so the XXE attacks that hit server-side parsers do not apply. A DOCTYPE with an internal subset is rejected.

## Is my XML uploaded?

No. Parsing and conversion run in your browser.

## Related tools

- /free-tools/json-formatter
- /free-tools/json-to-csv
- /free-tools/sitemap-xml-generator

## Last reviewed

2026-10-14.
