XML to JSON and JSON to XML Converter
Convert XML to JSON and back with configurable attribute prefix, text key, array handling and indentation. All conversion happens locally.
About This Tool
The XML and JSON converter moves data between the two formats that still dominate integrations. Older SOAP services, payment gateways and enterprise systems return XML, while modern frontends and APIs work with JSON. Instead of writing a throwaway script, paste the document and get the other representation immediately.
Attributes and text nodes need conventions, so the tool exposes them directly: choose the attribute prefix, the key used for text content, whether single elements should still be arrays, and the indentation. Conversion happens entirely in the browser, which matters when the payload contains internal endpoints or customer data.
Key Features
Two-way conversion
XML to JSON and JSON to XML on one page with a tab switch.
Attribute conventions
Set the attribute prefix such as @ or @_, and the key used for text nodes.
Array control
Optionally wrap every element in an array so consumers always see a consistent shape.
Readable output
Choose zero, two or four spaces of indentation for both directions.
When to Use It
Legacy API integration
Inspect an XML response from an older service in the JSON shape your code expects.
Build a JSON fixture
Convert a sample XML payload into JSON for mocks and unit tests.
Generate test XML
Turn a JSON fixture back into XML to exercise a SOAP endpoint or file import.
How to Use It
- 1Choose XML to JSON or JSON to XML.
- 2Paste the source document.
- 3Adjust attribute prefix, text key, array handling and indentation.
- 4Convert, then copy the result.
Frequently Asked Questions
Why do attributes appear as @id?
The prefix marks keys that become XML attributes. Change the prefix if your downstream tool expects a different convention such as @_ or _attributes.
Is anything uploaded?
No. Both directions run as local text processing inside the browser.
