XML to JSON

Convert parsed XML elements, attributes and text into JSON.

Local processing · Nothing is uploaded · 1 MB input limit

Input & settings

Paste text or drop a UTF-8 text file
Ready. Enter your input to begin.

How to use this tool

Paste well-formed XML and run the conversion. Inspect how element content, repeated children, attributes and namespaces are represented in JSON before reusing it.

Limits and behavior

Attributes use @_ prefixes and mixed text uses #text. Repeated element names become arrays. This is a data mapping; comments and exact mixed-content ordering are not retained. Maximum total input 1 MB, output 3 MB, JSON nesting 64 levels. Processing stays in your browser worker. Input is limited to 1 MB and output to 3 MB. No input content is saved by CraftAI.

Convert XML content into JSON

Read a well-formed XML document and map its elements and attributes to JSON for inspection or data exchange.

Is there one universal XML-to-JSON conversion standard?

No. XML supports attributes and mixed content that can be represented differently in JSON. Review the mapping.

Related tools: json to xml ·

Consider repeated XML child elements

An XML document containing two repeated <item> elements can require a JSON array to retain both items. Review how the converter maps them rather than expecting a universal representation.

Important: XML attributes, mixed content and ordering may not round-trip through a generic JSON representation. Keep the source document for verification.

Built on Hatchable