XML to JSON Converter — Free Online XML to JSON Tool
Free online XML to JSON converter. Convert XML to JSON instantly in compact, simple (xml2json-style) or full format, with native numbers & booleans, custom i...
To convert XML to JSON, paste your XML into the input box; the JSON appears instantly in the style and indentation you choose, ready to copy or download as .json.
Last updated:
XML to JSON Converter — Free Online XML to JSON Tool. Free online XML to JSON converter.
Convert XML to JSON instantly in compact, simple (xml2json-style) or full format, with native numbers & booleans, custom indentation and error line numbers — 100% in your browser.
Our free XML to JSON converter turns any XML document into clean, valid JSON in real time.
Paste a SOAP response, an RSS or Atom feed, a sitemap, a Maven POM, an Android resource file or any legacy configuration and convert XML to JSON instantly — no upload and no signup.
Attributes, nested elements, repeated tags, text content, CDATA sections, comments and the XML declaration are all mapped predictably, so you can transform XML to JSON for REST APIs, JavaScript front-ends, NoSQL databases or data pipelines without writing a single line of parsing code.
Choose the JSON layout that fits your code.
Compact mode follows the popular xml-js convention (_attributes, _text), Simple mode produces the familiar xml2json style with prefixed attribute keys, #text values and automatic arrays for repeated elements, and Full mode keeps the complete element tree with node types and document order.
Turn on native types to convert "42" and "true" into real JSON numbers and booleans, ignore comments or the declaration, and pick 2-space, 4-space, tab or minified indentation.
If your markup is broken, the XML to JSON parser tells you why and shows the line and column of the first error. Need to go the other way? Use our JSON to XML Converter, or tidy the source first with the XML Formatter.
All conversion happens locally in your browser, so API keys in SOAP headers, customer exports and internal configs never leave your device, and this XML to JSON online tool keeps working offline once loaded.
Load the book-catalog sample to see each mode, copy the JSON with one click, download it as converted.json, or share a link that restores your XML and options. Related tools: XML Minifier, JSON Viewer, JSON to YAML Converter and JSON to CSV.
Frequently asked questions
How do I convert XML to JSON?
Paste XML into Your XML content or click Load sample. Converted JSON updates as you type; click Copy JSON or Download .json to save it. If the XML is invalid, the error message includes the line and column.
What is the difference between the Compact, Simple and Full tree styles?
Compact nests elements by name and stores attributes under _attributes and text under _text. Simple is xml2json-style: attribute names get an at sign prefix, text goes under #text and repeated elements become arrays. Full tree keeps every node in order as an elements array with type and name fields.
How do I get JSON numbers and booleans instead of strings?
Turn on Convert numbers & booleans. Values such as 42, 3.14, true and false in element text and attributes are then written as JSON numbers and booleans instead of strings.
Can I leave out comments and the XML declaration?
Yes. Tick Ignore comments to drop XML comments and Ignore XML declaration to drop the xml version and encoding line. Set Indentation to 2 spaces, 4 spaces, Tab or Minified for one-line JSON.
Is my XML uploaded when converting to JSON?
No. The conversion runs entirely in your browser, so SOAP responses, feeds and config files you paste stay on your device.
How to use this online tool
XML to JSON Converter — Free Online XML to JSON Tool is designed for fast browser workflows when you need to format, validate, convert, decode, encode, generate, or inspect data without opening a heavy desktop app. Start with the input field or visible options, review the result, then copy or download the output for the next step.
Private processing in your browser
XML to JSON Converter — Free Online XML to JSON Tool keeps the normal processing step local in your browser. That is useful for code snippets, tokens, documents, configuration values, text samples, and other material that should not be sent to a remote service unless you explicitly choose to share it.
When this tool is useful
Use XML to JSON Converter — Free Online XML to JSON Tool for repeatable developer tasks, technical documentation, QA checks, quick conversions, debugging, content cleanup, and internal team workflows. The page focuses on clear inputs, immediate feedback, and output that is easy to reuse in code, reports, tickets, emails, or notes.
Practical tips
Before copying the final result, check important details such as spacing, casing, filenames, encoding, token structure, line breaks, or output format. Small checks prevent mistakes when the result is reused in source code, API requests, documentation, spreadsheets, or shared files.