XML to JSON

Convert XML to JSON in your browser. Attributes, text and repeated elements are all kept. Your file never leaves this page. Everything happens in your browser, and there is no upload endpoint to send it to — that is checked by a build gate that fails if any network code reaches a tool’s bundle.

How to do it

  1. Paste your XML, or drop the file onto the box.
  2. Press Convert to JSON.
  3. Press Copy.

Questions

Can I convert it back and get the same XML?

Not in general, and it is worth knowing why. XML distinguishes things JSON does not: an attribute becomes an @name key, text sitting beside elements becomes #text, and an element that appears once becomes an object where the same element appearing twice becomes an array. No converter can round-trip that without a schema.

Is it safe to paste XML from somewhere else?

Yes. Custom entity definitions are skipped rather than expanded, so the classic expansion and external-entity attacks have nothing to act on — and nothing here can read a file or make a request in any case.

Why was my file refused?

Mismatched or unclosed tags, which are named with the line they are on. This does not quietly repair broken markup, because a repaired tree is not the document you have.

Related tools

Browse every tool