Tools / convert

XML to JSON converter.

Paste XML on the left, get JSON on the right. Free, instant, and private — the conversion runs entirely in your browser using its built-in XML parser, so nothing is uploaded anywhere.

XML in
JSON out

The mapping in one line: attributes become @name keys, repeated elements become arrays, text next to child elements lands under #text, and comments are dropped. Hit Sample to see all four.

Going the other way? JSON to XML converter → · All free tools →

Do more with the JSON you just made

Converting XML to JSON is usually step one — the real work is reading what's inside. The jsonbolt desktop app is a GPU-accelerated JSON viewer: it opens clipboard JSON with one keystroke, parses at 3 GB/s, and searches 20 million results a second, on documents far bigger than a browser tab can hold.

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 — even a 1 GB payload renders instantly. (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.

Free for personal use — no signup. 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 20 million results per second, and can extract any subtree or export it as CSV, XML, or YAML.