- Executors
-
Learn
Python Learning Hub Runnable examples, NumPy, pandas, and more C & C++ Learning Hub Pointers, memory, STL, and modern C++ C# Learning HubC# basics, OOP, LINQ, async, and .NET exercises Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++
- Challenges
Converters
XML to JSON Converter
Convert XML documents to readable JSON, keeping attributes and turning repeated elements into arrays.
- Runs in your browser
- Instant results
- Free, no sign-up
Loading the tool…
How to use the XML to JSON Converter
- Paste your XML.
- Choose the attribute prefix and whether to detect numbers and booleans.
- Copy or download the JSON.
Frequently asked questions
How are XML attributes represented?
As keys with a prefix, @ by default, so <book id="1"> becomes {"@id": 1}.
What happens to repeated elements?
Elements that appear more than once under the same parent become a JSON array.
What if an element has both text and children?
The text is kept under a "#text" key next to the child elements.
Practice Python with coding challenges
Solve hands-on problems right in this editor: run the sample tests, submit, and get an AI code review.