Base64 to XML decoder
The Base64 to XML tool decodes a Base64 string and displays the XML inside with syntax highlighting. It is especially useful for single sign-on debugging: copy the SAMLResponse value from your browser’s network panel, paste it here, and read the assertion, its attributes, conditions and timestamps.
Example
Base64 input:
PD94bWwgdmVyc2lvbj0iMS4wIj8+Cjxub3RlPgogIDx0bz5Ub3ZlPC90bz4KICA8Ym9keT5Eb24ndCBmb3JnZXQgbWUhPC9ib2R5Pgo8L25vdGU+Decoded XML:
<?xml version="1.0"?>
<note>
<to>Tove</to>
<body>Don't forget me!</body>
</note>
Debugging SAML with this tool
- Open the browser developer tools, go to the Network tab and find the POST to your service provider’s assertion consumer URL.
- Copy the
SAMLResponseform field. If it contains%2Bor%3D, it is still URL-encoded — decode it with the URL Decoder first. - Paste it here and check the
Issuer,Audience,NotBefore/NotOnOrAftertimes,NameIDand attribute statements.
SAML requests sent with the redirect binding (in the URL as SAMLRequest=) are DEFLATE-compressed before Base64 encoding, so decoding them here shows binary data. Inflate them with Zlib Decompress, which handles raw DEFLATE.
What to look for in a SAML response
| Element | What to check |
|---|---|
Issuer | The identity provider’s entity ID, exactly as your service provider expects it. |
StatusCode | Should end in :Success; other values explain why login failed. |
NameID | The user identifier and its format (email, persistent ID, and so on). |
Conditions | NotBefore and NotOnOrAfter — clock differences between servers are a frequent cause of rejected logins. |
AudienceRestriction | Must match your service provider’s entity ID. |
AttributeStatement | The user attributes (email, groups, names) your application maps. |
Troubleshooting
- Hex dump instead of XML. The data is binary — compressed, encrypted (as with an EncryptedAssertion’s cipher value) or not XML at all.
- “unexpected character”. The string still contains URL encoding or JSON escaping such as
\/. Clean it up and try again. - Hex dump although the data is XML. The XML may use an encoding other than UTF-8, such as UTF-16. Bytes that are not valid UTF-8 are shown as a hex dump, never as garbled characters.
Recognizing Base64 XML before you decode it
Every XML document starts with <, so Base64-encoded XML almost always begins with the letter P. A few longer prefixes are worth knowing:
PD94bWwgis<?xml, a document with an XML declaration.PHNhbWxwOlJlis<samlp:Re, the start of a SAML response or request.//48is a UTF-16 byte order mark followed by<. The XML is in UTF-16, which is not valid UTF-8, so this tool shows it as a hex dump.- No
Pat the start usually means the XML was compressed before encoding, as SAML redirect bindings do with raw DEFLATE; inflate it with the zlib decompressor first.
Security reminder
A SAML response is a login credential for as long as it is valid. Decoding it locally is fine, and this tool uploads nothing unless you click Save & Share, but avoid creating share links for real assertions or posting them in tickets or chat. After decoding, you can tidy the document with the XML Formatter.