XML to JSON

Convert XML to JSON with attributes, repeated elements as arrays and typed values.

Convert XML to JSON with attributes, arrays and typed values

XML is still what many feeds, exports and enterprise systems produce, while almost every modern program wants JSON. XML to JSON converts an XML document into JSON using clear rules, so the result is predictable and easy to code against.

Paste the XML or drop an .xml file. Each element becomes an object keyed by its name; attributes become keys prefixed with @; text that sits next to child elements is kept under #text; an element that appears more than once under the same parent becomes an array; an empty element becomes null. Namespace prefixes are removed from names so that keys stay simple. Values that look like numbers or booleans are converted, which is right for most data feeds; choose to keep everything as text when identifiers such as product codes with leading zeros must survive untouched. Invalid XML is reported with the position of the error.

The conversion is designed to be reversible: JSON to XML understands the same @ and #text conventions and writes the elements back. For configuration files in YAML use YAML to JSON, and to check what changed between two exports run the results through Compare JSON.

How to use the XML to JSON tool

  1. Type or paste your XML, or open a file.
  2. Set your options: Value types.
  3. Click “Process XML to JSON” and download your result.

Common questions

Is XML to JSON free?

Yes. XML to JSON is free for light use with no signup needed. Anonymous visitors get 10 free tasks per day, and creating a free account makes daily use unlimited. A paid Pro plan removes ads and raises file-size limits for heavier work.

Is my file safe?

Yes. Your file is sent over HTTPS, processed by self-hosted open-source software on our servers (no third-party AI or cloud APIs), and deleted within 60 minutes at the latest, usually right after your result is ready.

What file formats does XML to JSON accept?

XML to JSON accepts XML files. Convert other formats to a supported one first; the related tools below can usually do it.

Related tools

Browse all 110+ free PDF, image, Markdown and JSON tools →