XML to JSON
Convert XML to JSON while keeping namespaces, attributes, text, and repeated children in order.
- Free
- Works Offline
- No Uploads
How to Convert XML to JSON
- Open the HTML, review Security Check, then select Continue.
- Choose a local XML document or select Open Sample.
- Choose Indented or Compact under JSON Layout, then select Convert to JSON.
- Preview the result, then select Download. Use Save As when the browser offers it.
Keep the Structure of the Original XML
- Use ordered child arrays for repeated elements, text, comments, CDATA, and processing instructions.
- Keep namespace URI, local name, and prefix for elements and attributes. Declarations stay with their elements.
- Save an indented or compact UTF-8 JSON file with XML values as strings.
Formats and Compatibility
| Input | A well-formed XML 1.0 file in UTF-8 or BOM-marked UTF-16. DTD and external attachments are outside the profile. |
|---|---|
| Output | A separate UTF-8 JSON object with prolog, root, and epilog. Both layouts preserve the same data. |
| Browser | A modern browser with local file support. |
| Scope | XML 1.0 without DTD or external XML attachments. Up to 2 Mi UTF-16 source units, 100,000 nodes and attributes, 128 element levels, and 64 MiB JSON. |
| Operating Systems |
Local Processing Without Uploads
Convert XML to JSON without uploading files. This offline, browser-based tool reads one selected file and needs no upload.
Select Open Sample to see the workflow with the included example.
From Namespaced XML to Ordered JSON
Names use localName, namespaceURI, and prefix. Attributes are name and string value records. Children keep source order in arrays. The XML parser applies its normal whitespace and entity handling.
Download and Inspect the JSON
Try the sample and inspect root.children in a JSON reader. The two p:item elements retain distinct attributes and the middle text remains a separate record.
Frequently Asked Questions
Can I convert XML to JSON offline?
Yes. Extract the Tool ZIP and open XMLToJSON.html in a compatible browser.
How does local XML to JSON handle repeated elements?
Each occurrence is a separate record in the containing element’s children array. Text in between appears at its own position.
Where can I use free XML to JSON conversion?
Open the free converter here or extract the offline ZIP.
What does the XML to JSON download include?
The Tool ZIP contains the standalone converter and its instructions. Download in the converter saves the converted JSON.
Can I convert XML to JSON in browser mode?
Yes. The XML to JSON browser tool writes indented or compact JSON directly on your device.
What does XML to JSON online mean here?
The hosted page launches the XML to JSON tool. The source is read and converted locally.
Are numbers and booleans inferred from XML text?
No. Parsed values such as 001, 9007199254740993, false, and null remain JSON strings.
How are attributes and namespaces represented?
Attributes are records with name and value. Names expose localName, namespaceURI, and prefix. Each element also lists the namespace bindings declared on it. Declarations and attributes are sorted by name, and child content stays in source order.
Does this tool work offline on Windows, macOS, Linux, and ChromeOS?
Yes. Local Studio tools run offline on Windows, macOS, Linux, and ChromeOS. Download the tool ZIP, extract it, and open the included HTML file in a supported browser. Your files are processed on your device without uploads.
Which browsers can I use with this offline tool?
Use a current version of Google Chrome, Microsoft Edge, Mozilla Firefox, or Safari where that browser is available for your operating system. Chrome is built into ChromeOS, and Safari is available on macOS.