XML to JSON Converter transforms any XML document into equivalent, well-formed JSON. Paste an XML payload — a SOAP response, an RSS feed, a config file, an API export — and get back clean, indented JSON that maps elements to keys, repeated tags to arrays, and attributes to prefixed properties, ready to use in JavaScript, a REST client, or a data pipeline.
XML and JSON model data differently, and a naive conversion loses information. XML has attributes, which JSON has no direct equivalent for; it allows an element to hold both attributes and text; and it distinguishes a single child from a list only by repetition. This converter handles each case deliberately: attributes become keys with a configurable prefix (@ by default), mixed content keeps its text under a #text key, and any tag that appears more than once collapses into a JSON array so your structure stays faithful to the source.
Everything runs 100% in your browser using a dependency-free parser — no DOMParser, no server round trip. XML documents frequently carry internal identifiers, customer records, or integration payloads, so nothing you paste is uploaded or stored. The converter works offline once loaded, and options let you decode entities, parse numeric and boolean text into real types, and ignore attributes when you only need the element data.
Paste any well-formed XML document into the input panel — with or without an XML declaration — or click Load Sample to start from a realistic catalog example with attributes and nested lists.
Pick 2-space or 4-space indentation, decide whether attributes are included, and optionally enable type parsing to turn "44.95" and "true" into a real number and boolean.
Click Convert. The XML is parsed and validated first — malformed markup like a mismatched or unclosed tag is reported with a clear message so you can fix it.
Copy the generated JSON to your clipboard or download it as a .json file, then drop it into your code, request body, or data store.
XML attributes are preserved as JSON keys with a configurable prefix (@ by default), so no data is lost in the conversion
Repeated child elements automatically become a JSON array, while a single occurrence stays a plain object — matching the real structure
CDATA blocks are taken verbatim and standard plus numeric entities (&, é) are decoded correctly into their characters
Turn numeric and boolean text like "3.14" or "false" into real JSON numbers and booleans, or keep everything as strings — your choice
Convert JSON to well-formed XML instantly. Map object keys to elements, @-prefixed keys to attributes and #text to content, expand arrays into repeated tags, and export minified or pretty-printed XML. 100% client-side.
Format, validate, and minify JSON data
Convert CSV data to JSON format with support for quoted fields, type inference, and various delimiters
0 comments
No comments yet. Be the first to share your thoughts!