Base64 to XML Converter

Decodes a Base64 string back to its original UTF-8 text, then validates and pretty-prints that text as XML, the reverse of this category's XML to Base64 Converter. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-23

Overview

Introduction

Once XML has been Base64-encoded for safe transport inside JSON, a URL, or a binary field, you eventually need it back in readable form. This tool decodes that string and immediately validates and formats the result as XML, in one step.

It's the natural counterpart to the XML to Base64 Converter, and useful any time you're handed a Base64 blob that's supposed to contain XML and need to confirm what's actually inside it.

What Is Base64 to XML Converter?

A Base64-to-XML converter that decodes a Base64 string back into UTF-8 text, then parses and pretty-prints that text as XML using this category's shared parser and formatter.

Decoding and XML validation happen as two distinct, clearly reported steps, so a failure at either stage tells you exactly what went wrong instead of a single opaque error.

How Base64 to XML Converter Works

The input is decoded from Base64 using the browser's built-in decoding, then the resulting bytes are interpreted as UTF-8 text.

That text is parsed with the same well-formedness checker used by the XML Validator; on success, the result is re-serialized with standard indentation via the same formatter behind the XML Prettifier.

When To Use Base64 to XML Converter

Use it when you've received a Base64 string that's supposed to decode to XML, an API response, a config value, an email attachment payload, and need to inspect its actual content.

It's also useful for verifying that an XML to Base64 Converter round trip produced the document you expected.

Features

Advantages

  • Runs entirely client-side, so decoded content with real configuration or credential data never leaves your browser.
  • Reports decoding failures and XML syntax errors as two distinct, clearly labeled steps.
  • Automatically pretty-prints the decoded document, useful when the original was encoded in minified form.
  • Handles UTF-8 multi-byte characters correctly, not just plain ASCII.

Limitations

  • Only checks well-formedness of the decoded text, not conformance to a specific XSD or DTD schema.
  • Assumes the Base64 payload represents UTF-8 text; binary data that isn't valid UTF-8 will fail to decode cleanly.
  • Very large inputs (tens of megabytes) may be slow, since decoding and parsing both hold the full content in memory.

Examples

Decoding a small Base64 payload

Input

PGE+MTwvYT4=

Output

<a>1</a>

The Base64 string decodes to the original, well-formed XML document.

Invalid Base64 is caught immediately

Input

not-valid-base64!!

Output

Input is not valid Base64.

The decode step fails before any attempt is made to parse the result as XML.

Valid Base64 that decodes to broken XML

Input

PGE+MTwvYj4=

Output

Expected closing tag </a> but found </b>

Decoding succeeds, but the resulting text (<a>1</b>) isn't well-formed XML, so the XML parser's own error is reported.

Best Practices & Notes

Best Practices

  • Check whether a decode failure is about the Base64 encoding itself or the XML inside it, the error message distinguishes the two.
  • Pair with the XML to Base64 Converter to confirm a full round trip preserves your intended document.
  • Trim stray whitespace or line breaks from a Base64 string copied out of a log or header before pasting.

Developer Notes

`base64ToXml` (in this category's `lib/base64-to-xml-converter.ts`) decodes with `atob`, converts the resulting binary string to bytes, and decodes those as UTF-8 via `TextDecoder` with `fatal: true` so malformed byte sequences throw immediately rather than producing replacement characters. The decoded text is then parsed with `parseXmlDocument` and re-serialized with `toPrettyXml`, both from `xml-core.ts`.

Base64 to XML Converter Use Cases

  • Inspecting the actual XML content behind a Base64-encoded API field or config value
  • Verifying a full encode/decode round trip through the XML to Base64 Converter
  • Decoding an XML payload embedded in an email header or binary protocol field
  • Debugging a system that stores or transmits XML as a Base64 string

Common Mistakes

  • Pasting a Base64 string with stray line breaks or surrounding quotes copied from a log, which breaks decoding.
  • Assuming a decode success guarantees valid XML, decoding and XML well-formedness are checked separately.
  • Expecting binary (non-text) Base64 payloads to decode meaningfully as XML, this tool assumes UTF-8 text.

Tips

  • Use the reported error to tell whether the problem is the Base64 encoding or the decoded XML's syntax.
  • Pair with the XML to Base64 Converter to check what a round trip does to your specific document.
  • Expect the output to always be pretty-printed, even if the original document was minified before encoding.

References

Frequently Asked Questions