XML to JSON Converter — Free Online XML to JSON Conversion Tool
Convert XML to JSON format — parse XML element trees into JSON objects and arrays.
Jump to tool ↓Frequently Asked Questions
XML to JSON Conversion for Modern APIs
Converting XML to JSON is a common task when integrating legacy systems with modern APIs. SOAP web services, RSS feeds, sitemap files, Android string resources, and many enterprise systems use XML. Transforming these to JSON makes the data accessible to JavaScript frontends, REST APIs, and JSON-native databases.
The conversion algorithm traverses the XML DOM tree recursively. Each element becomes a JSON key. Leaf elements without attributes become string values. Elements with attributes or children become nested objects. When multiple sibling elements share a tag name, they're combined into a JSON array — this handles lists, collections, and repeated records.
Try the sample order: <order id="1001"> becomes anorder object with @id equal to "1001". The two item elements become an array, and each sku attribute is retained as @sku. A single item would be an object instead of an array; consumers that expect a list should normalize that field after conversion.
Attribute values and element text remain strings; the converter does not infer numbers, booleans, or dates. It combines direct text into #text when an element also has attributes or children. CDATA text is included, while comments and processing instructions are omitted. Mixed content and namespace-aware XML need extra review because their full meaning cannot be reconstructed from this JSON shape.
Standards & References
Built and maintained by DevDecode. This tool processes your input in your browser; it is not uploaded for processing. Found an issue? Let us know.
Related Tools
Related Guides
How to Open an XML File (and Convert It)
Open an XML file in a browser, text editor, or Excel — and convert it to JSON or a spreadsheet. Easy step-by-step methods for any device.
Data FormatsHow to Convert XML to JSON Without Losing Attributes
Convert XML elements and attributes to JSON with a tested example. See how repeated elements, text, namespaces, and mixed content map in DevDecode's browser tool.