Skip to content
empinet.dev
XML

XML to JSON

Parse XML into formatted JSON with explicit conventions for attributes, text, and repeated elements.

Conversion workspace

Parse XML into formatted JSON while preserving text values.

XML input
JSON output

Attributes use @_name, text uses #text, and repeated elements become arrays. Your data stays on this device.

Predictable output keys

Attributes use keys beginning with @_, mixed text uses #text, and repeated sibling elements become arrays.

Text stays text

XML text and attribute values remain strings, preventing values such as version 001 from being silently changed into numbers. DOCTYPE declarations are not accepted.

XML to JSON FAQ

How are repeated elements represented?

Repeated elements with the same name are returned as a JSON array in their original order.

Does conversion infer numbers or booleans?

No. XML does not define those data types, so element text and attributes remain strings.