Base64 to XML Decoder Online — Decode & View

Decode Base64-encoded XML, parse it as a document, and pretty-print with namespaces preserved — built for SOAP envelopes, MTOM/XOP attachments, and XML payloads embedded in JSON APIs.

What is a Base64 to XML decoder?

A Base64 to XML decoder reverses Base64 encoding to recover the original byte stream and parses those bytes as an XML document. It is the standard tool for unwrapping SOAP attachments, MTOM-inlined XML payloads, and XML blobs embedded inside JSON envelopes that travel through enterprise integration buses.

Legacy enterprise systems still encode XML as Base64 to push it through transports that cannot carry raw markup safely — JSON fields, HTTP headers, JMS payloads, message-bus envelopes. The OpenFormatter decoder accepts both standard Base64 and Base64url, runs the decoded text through the browser's native DOMParser to confirm the XML is well-formed, then pretty-prints with consistent indentation while preserving namespaces.

How to decode Base64 to XML — 4 steps

  1. Paste the Base64 string. A SOAP envelope, MTOM-extracted attachment, or any embedded XML payload. Click Load Sample for a demo SOAP envelope.
  2. Click Decode. The tool normalises Base64url characters, re-pads if needed, decodes through UTF-8, and parses with DOMParser.
  3. Read the XML. A green Done badge means well-formed XML. The pretty-printed document appears with namespaces and prefixes intact.
  4. Copy the formatted XML. Send it to a SOAP client, an XSD validator, or a debugging log.

Sample input and output

Base64 input (SOAP envelope)

PHNvYXA6RW52ZWxvcGUgeG1sbnM6c29h
cD0iaHR0cDovL3NjaGVtYXMueG1sc29h
cC5vcmcvc29hcC9lbnZlbG9wZS8iPjxz
b2FwOkJvZHk+PEdldFByaWNlPjxJdGVt
PldpZGdldDwvSXRlbT48L0dldFByaWNl
Pjwvc29hcDpCb2R5Pjwvc29hcDpFbnZl
bG9wZT4=

Decoded XML output

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetPrice>
      <Item>Widget</Item>
    </GetPrice>
  </soap:Body>
</soap:Envelope>

SOAP-Friendly

Pretty-prints SOAP envelopes with prefixed namespaces (soap:, xsi:, custom) intact — exactly the way the SOAP runtime sees them.

Well-Formedness Check

DOMParser surfaces parse errors so you know whether the issue is the Base64 layer or the XML inside it.

Local Decoding

Decoding and parsing happen in your browser tab. SOAP payloads carrying credentials and PII never leave the device.

Common use cases

  • check_circleDecoding SOAP with Attachments (SwA) payloads inlined as Base64 in xop:Include elements
  • check_circleReading MTOM-optimized XML attachments captured from SOAP traffic
  • check_circleInspecting Base64-encoded XML stored in SQL Server or Oracle BLOB columns
  • check_circleDecoding XML inside JSON API responses from legacy enterprise integration buses
  • check_circleReading Base64-encoded XML claims from SAML assertions during SSO debugging
  • check_circleInspecting XML payloads from healthcare HL7 or FHIR systems wrapped in Base64
  • check_circleDecoding XML attachments returned from EDI/EDIFACT translators
  • check_circleReading XML config blobs stored as Base64 in environment variables

Base64 to XML vs plain Base64 decode

A plain Base64 decoder dumps raw text — fine for short payloads but useless for hundreds of lines of unformatted XML. This decoder fuses Base64 decode with DOMParser-based parsing and pretty-printing, so a malformed XML inside valid Base64 surfaces immediately rather than silently dumping a broken document. For non-XML binary content (PDFs, images, gzip), use a generic Base64 decoder instead.

More you can do with the XML?

Format, validate, or convert the decoded XML with the rest of OpenFormatter — all in your browser.

Frequently Asked Questions

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.

Base64 to XML Decoder Online — Decode & View