Why is my SOAP attachment Base64-encoded?
SOAP with Attachments (SwA) and MTOM (Message Transmission Optimization Mechanism) carry binary or large XML attachments alongside the SOAP envelope. The simplest interop path is to inline the attachment as a Base64-encoded string inside an element such as <xop:Include> or a custom binary element. Decoding the Base64 reveals the original XML attachment so you can inspect or replay it.
How do I decode an MTOM-extracted XML payload?
When MTOM optimization is disabled or the SOAP runtime inlines the binary, the attachment becomes a Base64 string in the XML. Copy the contents of the <xop:Include> or base64Binary element, paste here, click Decode, and the original XML attachment is reconstructed and pretty-printed.
Does this handle XML with declarations and namespaces?
Yes. The decoded text is parsed by the browser DOMParser as application/xml, which understands XML declarations (<?xml version="1.0"?>), default namespaces, and prefixed namespaces (xmlns:soap=...). The pretty-printer preserves namespace prefixes on every element.
What is the difference between SwA and MTOM?
SOAP with Attachments (SwA) uses MIME multipart with Content-ID references. MTOM is the modern W3C standard that uses XOP (XML-binary Optimized Packaging) — the binary is referenced via <xop:Include href="cid:..."> inside a multipart message. Either way, when an intermediary inlines the binary as Base64 inside the XML, this tool decodes it.
My decoded content has parsererror — what now?
The Base64 decoded successfully but the bytes are not well-formed XML. Common causes: the original was a binary file (PDF, image), the XML was truncated during copy, or the encoding was double-Base64. View the raw bytes with a plain Base64 decoder to confirm what you actually have.
Does it handle Base64url variants?
Yes. The decoder normalises - to + and _ to / and re-pads as needed before invoking atob, so Base64url strings (common when XML is shoehorned into JWT-style claims or URL parameters) decode without manual fix-up.
Will this validate against an XSD or DTD?
No. This decoder only checks well-formedness — that the XML parses cleanly. For schema validation against an XSD, DTD, or RelaxNG schema, run xmllint locally or use a dedicated schema validator after pretty-printing the output here.
Is the XML uploaded anywhere?
No. Decoding, parsing, and pretty-printing all run inside your browser via atob and DOMParser. SOAP envelopes often contain credentials, account numbers, and PII — verify in DevTools Network tab that nothing leaves the page.