Tools / convert

XML to JSON converter.

The conversion runs entirely in your browser, nothing is uploaded. Going the other way? JSON to XML converter →

XML in
JSON out
DESKTOP APP

Do more with the JSON you just made

The jsonbolt desktop app opens clipboard JSON with one keystroke, even documents far bigger than a browser tab can hold. It can search millions of results a second.

01

Copy the JSON

One click on Copy above, or copy JSON from a terminal, an API client, a log file.

02

Press Win + J J

jsonbolt launches and opens your clipboard in one step. (Opt-in: Settings → Launch.)

03

Explore & export

Search the tree, extract any subtree by path, and export the selection as CSV, YAML, or back to XML.

YAML, CSV, and XML export are built in.

How XML maps to JSON

XML and JSON disagree about the basics, XML has attributes, mixed content, and comments; JSON has arrays and types. This converter uses the most common convention so the output is predictable:

XMLJSON
Element with childrenObject, keyed by child names
Attributes"@name" keys on the element's object
Repeated sibling elementsAn array under the shared name
Text-only elementA plain string
Empty element <a/>null
Text beside child elements or attributes"#text" key
CDATA sectionsTheir text content
Comments, processing instructionsDropped, JSON has no equivalent
Namespaced names (ns:tag)Kept verbatim, prefix and all

How this converter handles the details

FAQ

How do I convert XML to JSON?

Paste your XML into the input pane at the top of this page. The JSON equivalent appears instantly in the output pane, copy it to your clipboard or download it as a .json file. The conversion runs locally in your browser.

How are XML attributes represented in JSON?

Each attribute becomes a key prefixed with @, <server port="8080"> becomes {"server": {"@port": "8080"}}. When an element has both attributes and text, the text lands under the "#text" key.

Why are all the values strings in the JSON output?

XML has no data types, every value is text. This converter keeps them as strings rather than guessing, so "1.10" doesn't silently become 1.1 and version numbers, ZIP codes, and IDs survive intact.

How does the converter decide what becomes a JSON array?

Repeated sibling elements with the same name become an array: two <port> elements produce "port": ["8080", "9090"]. A single occurrence stays a plain value, check the sample to see both.

Is my XML uploaded to a server?

No. The converter uses your browser's built-in XML parser and runs entirely locally. Your data never leaves your machine.

How do I explore a large JSON file after converting?

Copy the JSON output and press Win + J J, the jsonbolt desktop app launches and opens your clipboard instantly. It parses at 3 GB/s, searches millions of results a second, and can extract any subtree or export it as CSV, XML, or YAML.