XML to JSON Converter

Convert XML to JSON, directly in your browser, using a clear and consistent attribute/element convention.

Developer Tools

Convert XML to JSON, directly in your browser, using a clear and consistent attribute/element convention.

Your XML is processed locally in your browser and is not uploaded to our server.

How XML and JSON Map to Each Other

XML and JSON are structured differently — XML has elements and attributes, JSON has objects and arrays — so converting between them needs a consistent convention, not a literal one-to-one translation. This tool uses the same convention most XML/JSON converters use:

  • An element’s attributes become an @attributes object.
  • An element’s direct text content (when it also has attributes or children) becomes a #text value.
  • Multiple sibling elements with the same tag name become a JSON array.
  • The single XML root element becomes JSON’s one top-level key.

One Honest Limitation

XML has no native number, boolean, or null types — everything in XML is text. This means a JSON true, false, or a number will come back as the literal text “true”, “false”, or the number’s digits after converting to XML and back — this is a property of the XML format itself, not a bug in this tool.

FAQ

Is my XML uploaded anywhere?

No. The conversion happens entirely in your browser, using the browser’s own built-in XML parser. Your data is never sent to our server.

Are XML comments included in the JSON output?

No, comments and processing instructions are not represented in the JSON output — this is a data converter, not a formatter that preserves every markup detail. See XML Formatter if you need to preserve comments.

What happens to XML namespace prefixes?

Namespace prefixes are kept as literal text in element and attribute names, not resolved to their full namespace URIs.