SOAP XML to JSON Converter
Paste a SOAP XML envelope and instantly convert it to clean JSON with namespace stripping and body extraction
Paste a SOAP XML envelope and get structured JSON back in one click — namespace prefixes stripped, Body content extracted, indentation applied. Handles nested elements, attributes, and fault responses without extra config. And everything runs in your browser. Nothing gets uploaded.
How It Works
Your browser’s built-in DOMParser reads the SOAP XML, locates the Envelope, Header, and Body elements, then recursively walks each node to build a JSON object. Namespace prefixes get stripped by default (so soap:Body becomes just Body). The result is syntax-highlighted and ready to copy or download as a .json file.
Examples
Simple GetUser Response
A typical SOAP response from a user lookup service — one of the most common things you’ll need to convert.
<soap:Envelope xmlns:soap="...">
<soap:Body>
<GetUserResponse>
<UserId>4821</UserId>
<Name>Jane Park</Name>
<Email>[email protected]</Email>
</GetUserResponse>
</soap:Body>
</soap:Envelope>
{
"Body": {
"GetUserResponse": {
"UserId": "4821",
"Name": "Jane Park",
"Email": "[email protected]"
}
}
}
SOAP Fault Error
When an API returns an error, the fault details are buried inside nested XML. Converting to JSON makes the error code and message immediately visible.
<soap:Envelope xmlns:soap="...">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>Account suspended</faultstring>
<detail>
<errorCode>ERR_403</errorCode>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
{
"Body": {
"Fault": {
"faultcode": "soap:Server",
"faultstring": "Account suspended",
"detail": {
"errorCode": "ERR_403"
}
}
}
}
Multi-Item Order Response with Attributes
Real-world SOAP responses often include XML attributes on elements. With “Include attributes” turned on, those get preserved as @-prefixed keys.
<soap:Envelope xmlns:soap="...">
<soap:Body>
<OrderResponse status="complete">
<Item id="A1">Widget</Item>
<Item id="A2">Gadget</Item>
<Total currency="USD">84.50</Total>
</OrderResponse>
</soap:Body>
</soap:Envelope>
{
"Body": {
"OrderResponse": {
"@status": "complete",
"Item": [
{"@id": "A1", "#text": "Widget"},
{"@id": "A2", "#text": "Gadget"}
],
"Total": {
"@currency": "USD",
"#text": "84.50"
}
}
}
}
Who Uses This
Parsing SOAP responses from legacy APIs before feeding data into modern REST or GraphQL services.
Comparing SOAP response payloads by converting them to JSON for easier diff and assertion checks.
Pulling structured data out of SOAP exports so it can be loaded into Python, R, or spreadsheet tools.
Debugging SOAP-based health checks and monitoring endpoints by converting responses to JSON for log parsing.
Common Mistakes
The converter looks for a <soap:Envelope> wrapper to know it’s dealing with SOAP. If you paste just the inner XML, it still converts fine — but it won’t strip the envelope automatically because there’s no envelope to strip. Paste the full response for best results.
Attributes are off by default. If your SOAP response has data stored in attributes (like id="123" or type="string"), you’ll lose that information unless you toggle the option on before converting.
Copying from a log viewer or terminal sometimes chops off closing tags or adds line numbers. If you see “XML Parse Error,” check that your input starts with <?xml or <soap:Envelope and that every tag is properly closed.
Technical Details
- Processing: 100% client-side — uses the browser’s native DOMParser API
- Browser Support: Chrome, Firefox, Safari, Edge
- Max Input Size: Limited only by your browser’s memory (typically 50MB+)
- Output Format: Standard JSON with configurable 2-space or 4-space indentation
- Namespace Handling: Optional prefix stripping, xmlns attributes always excluded
Frequently Asked Questions
How do I convert SOAP XML to JSON?
Paste the full SOAP XML response into the input box and click Convert. The tool parses the envelope, pulls out the Body content, and gives you formatted JSON. You can copy it to your clipboard or download it as a file.
What are SOAP namespaces and should I strip them?
SOAP namespaces are prefixes like soap:, ns1:, or wsdl: attached to XML element names. They prevent naming conflicts in XML but make JSON keys ugly and hard to work with. Most people strip them — it turns ns1:GetUserResponse into just GetUserResponse.
Does this tool upload my SOAP data to a server?
No. Everything happens locally in your browser using JavaScript. Your XML is never sent anywhere. You can disconnect from the internet and the tool keeps working — that is the easiest way to verify it yourself.
Can I convert non-SOAP XML with this tool?
Yes. If the input isn’t wrapped in a SOAP Envelope, the converter treats it as plain XML and converts it to JSON anyway. It just won’t do the automatic envelope/body extraction since there is no envelope to extract from.
How are XML attributes handled in the JSON output?
Turn on “Include attributes” in the options. Attributes show up with an @ prefix — so id="42" on an element becomes "@id": "42" in the JSON. Text content inside that element goes into a #text key. Attributes are skipped by default to keep output cleaner.