Skip to the tool
ToolOcean

XML to JSON

Open an XML file locally or paste it. Attributes can be kept as their own keys, and repeated elements can be forced into arrays. The page shows an error if the XML does not parse.

Runs in your browser. Nothing is uploaded.

How it works

  1. Step 1: Paste your inputPaste directly into the editor, drop a file onto it, or use "Open file" to pick one from your device. Nothing is sent anywhere when you do.
  2. Step 2: ConvertAdjust the options if you need to, then run it. Results appear beside your input so you can compare the two.
  3. Step 3: Copy or download the outputCopy the result to your clipboard in one click, or save it as a file. You can also keep editing and re-run as many times as you like.

About this tool

What XML to JSON keeps

This address starts in XML-to-JSON. Two switches matter. Attributes can be kept as their own keys so a name on a tag does not collapse into the element's text. Explicit arrays force a single child into a list, so a later second sibling does not change the shape from an object to an array. Leave that off if you want the smaller tree and you know the document never repeats a tag.

Open an XML file locally or paste. A document that does not parse shows the parser error and writes nothing. Namespaces and attribute order are not promised back. JSON to XML is the other address, and it writes elements rather than restoring attributes. Use this page when the file you have is markup. The swap control remains if you already have JSON in the box.

Parsing uses the browser DOMParser. A parsererror element becomes the message, usually the first line of that browser text. The JSON object is keyed by the document element, so the root tag is kept. Processing instructions and the XML declaration are not copied across. The saved file is named converted.json.

  • Runs in your browser. All processing happens locally in this tab using JavaScript.
  • No uploads. Your data is never sent to a server. There is no server to send it to.
  • Works offline. Once the page has loaded you can disconnect and keep working.
  • Unlimited & free. No usage caps, no paywall, no file size tiers.

Start with your own data. Open a file

What happens to your data

The same questions a security review would ask, answered plainly.

Read via
Typed or pasted into the page
Held in
Your browser tab's memory for as long as it is open
Stored
Nothing. No cookies, no database, no server-side copy
Transmitted
Nothing leaves your device
Retained after you close the tab
Nothing
Works offline
Yes, once the page has loaded

Why use this tool

What you get here that a server-side alternative cannot offer.

  • Your data never leaves the tab

    There is no upload step and no server to receive one. The page loads once, then all work on your data happens in local JavaScript.

  • No caps or paywalls

    No daily limits, no per-file ceilings imposed by a server tier, no watermarks, and no account. The practical limit is your own device's memory.

Frequently asked questions

Is my XML uploaded to a server?

No. Everything runs locally in your browser using JavaScript. Your data is never uploaded to a server, and nothing is stored or logged.

What does the attribute switch change?

On, attributes are kept distinct from child elements so a name="x" does not disappear into the element text. Off, you get a simpler tree and you lose that distinction.

Why force arrays?

A single child is easy to mistake for one object, until a second sibling appears and the shape changes. Explicit arrays keep one child and many children in the same shape.

How much data can I paste in?

There is no server-side cap. Very large inputs are limited only by your device's memory and will make the page feel slower, since the work happens on the main thread. In practice a few megabytes of text is comfortable.

Does it work offline?

Yes, once the page has loaded. The code that does the work is already in your browser at that point, so you can disconnect and keep using it. Reloading the page while offline needs the browser cache to still hold it.

Do I need to create an account?

No. There is no sign-up, no email, and no usage tracking tied to an identity. The tool works the first time you open it.