Xerobit

SAML Decoder: Decode and Inspect SAML Assertions

Paste a base64 or URL-encoded SAML response or request to decode it into formatted XML and extract the Issuer, NameID, attributes, audience and NotBefore and NotOnOrAfter times. This saml decoder runs entirely in your browser so no data is uploaded.

Accepts raw base64, URL-encoded base64, or already-decoded XML.

Decoded XML

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_abc123" Version="2.0">
  <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">https://sp.example.com</Issuer>
</samlp:AuthnRequest>
  • Type
    AuthnRequest
  • Encoding
    Plain XML (no encoding)
  • ID
    _abc123
  • Issuer
    https://sp.example.com

How to use the saml decoder

  1. Copy the SAMLRequest or SAMLResponse value from your browser address bar, network tab or log file.
  2. Paste the encoded string into the input area above.
  3. The saml decoder automatically detects URL encoding and base64, then decodes the payload.
  4. Review the extracted fields (Issuer, NameID, Destination, Conditions) and the pretty-printed XML output.

How the decoding works

A SAML message travels between an identity provider and a service provider as XML that has been encoded in one of two ways. The HTTP POST binding sends the XML as plain Base64 in a form field. The HTTP Redirect binding compresses the XML with raw DEFLATE (RFC 1951), Base64-encodes it and then percent-encodes it into the URL. This saml decoder reverses whichever layers it finds. If you paste a form body or URL it first extracts the SAMLRequest or SAMLResponse value, then percent-decodes it, Base64-decodes it (standard or URL-safe alphabet, with or without padding) and, if the bytes are not already XML, inflates them. The XML is then split into tags and indented so every element and attribute is on its own line.

For example, PHNhbWxwOkF1dGhuUmVxdWVzdD4= decodes to the bytes of <samlp:AuthnRequest>, and the same string percent-encoded as PHNhbWxwOkF1dGhuUmVxdWVzdD4%3D gives the same result.

Using it as a SAML response decoder

A SAML response is the base64 text your identity provider posts back to the service provider in the SAMLResponse form field. Paste that value here and the tool shows the decoded XML plus a summary of the fields you usually need when a login fails: the status, Issuer, Destination, InResponseTo, NameID, NotBefore and NotOnOrAfter, the audience restriction and the assertion attributes. If the message was deflated, as redirect-binding requests are, the tool inflates it first.

The signature is reported as present or absent but is not verified, and an encrypted assertion cannot be read without the private key.

Key SAML elements explained

When you inspect a decoded assertion, several elements carry the most important information for debugging authentication flows.

ElementPurpose
IssuerThe entity ID of the party that created the message (IdP or SP).
NameIDThe identifier for the authenticated subject, often an email or username.
DestinationThe URL where the message is intended to be received.
NotBeforeThe earliest time at which the assertion is valid.
NotOnOrAfterThe expiration time after which the assertion must be rejected.
AudienceThe service provider entity ID for which the assertion is intended.

This saml decoder extracts each of these values and presents them above the full XML so you do not have to search through deeply nested elements manually.

Common use cases

Developers and administrators use a saml decoder in several practical situations:

  • Debugging SSO failures: When a login loop occurs, decoding the assertion reveals mismatched audiences, expired timestamps or incorrect destinations.
  • Verifying IdP configuration: After changing identity provider settings, you can confirm the correct attributes and NameID format are being sent.
  • Auditing claims: Security teams inspect assertions to ensure only expected user attributes are transmitted.
  • Building integrations: When writing custom SAML handling code, seeing the exact XML structure helps map fields correctly.

If you need to inspect specific message types in isolation, a dedicated SAML request decoder is also available on Xerobit.

Common mistakes and edge cases

A few issues frequently trip up manual decoding:

  • Double encoding: some systems percent-encode an already percent-encoded string. This tool decodes one level; if the result still contains % sequences, run the decoded text through it again.
  • Missing padding: Base64 strings should end with zero, one or two = characters, and some senders strip them. The decoder accepts input without padding.
  • Truncated payloads: proxies and servers often cut very long URLs. A cut-off redirect payload fails with a message that the compressed data ends unexpectedly.
  • Wrong parameter: only SAMLRequest and SAMLResponse values are SAML messages; RelayState is an unrelated opaque string.
  • Encrypted assertions: an EncryptedAssertion is shown as encrypted XML. It cannot be read without the service provider private key.

Worked examples

ExampleInputResult
AuthnRequestEncoded SAML payload: PHNhbWxwOkF1dGhuUmVxdWVzdCB4bWxuczpzYW1scD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOnByb3RvY29sIiBJRD0iX2FiYzEyMyIgVmVyc2lvbj0iMi4wIiBJc3N1ZUluc3RhbnQ9IjIwMjQtMDEtMDFUMDA6MDA6MDBaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9pZHAuZXhhbXBsZS5jb20vc3NvIj48SXNzdWVyIHhtbG5zPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6YXNzZXJ0aW9uIj5odHRwczovL3NwLmV4YW1wbGUuY29tPC9Jc3N1ZXI+PC9zYW1scDpBdXRoblJlcXVlc3Q+Type: AuthnRequest; Encoding: Base64 XML (HTTP-POST style); ID: _abc123; IssueInstant: 2024-01-01T00:00:00Z; Issuer: https://sp.example.com; Destination: https://idp.example.com/sso
URL-encoded payloadEncoded SAML payload: PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48czpSZXNwb25zZSB4bWxuczpzPSJ1cm46b2FzaXM6bmFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiIERlc3RpbmF0aW9uPSJodHRwczovL3NwLmV4YW1wbGUuY29tL2FjcyI+PHM6SXNzdWVyPmh0dHBzOi8vaWRwLmV4YW1wbGUuY29tPC9zOklzc3Vlcj48czpBc3NlcnRpb24+PHM6U3ViamVjdD48czpOYW1lSUQ+dXNlckBleGFtcGxlLmNvbTwvczpOYW1lSUQ+PC9zOlN1YmplY3Q+PHM6Q29uZGl0aW9ucyBOb3RCZWZvcmU9IjIwMjQtMDEtMDFUMDA6MDA6MDBaIiBOb3RPbk9yQWZ0ZXI9IjIwMjQtMDEtMDFUMDE6MDA6MDBaIj48L3M6Q29uZGl0aW9ucz48L3M6QXNzZXJ0aW9uPjwvczpSZXNwb25zZT4%3DType: Response; Encoding: Base64 XML (HTTP-POST style); Issuer: https://idp.example.com; Destination: https://sp.example.com/acs; NameID: user@example.com; NotBefore: 2024-01-01T00:00:00Z; NotOnOrAfter: 2024-01-01T01:00:00Z; Assertions: 1
Plain XML passthroughEncoded SAML payload: <samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_xyz" Version="2.0"><Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">sp.example.com</Issuer></samlp:AuthnRequest>Type: AuthnRequest; Encoding: Plain XML (no encoding); ID: _xyz; Issuer: sp.example.com

FAQ

What does a saml decoder do?

It takes a base64 or URL-encoded SAML payload and converts it back into human-readable XML. It also extracts key fields like the Issuer, NameID and validity conditions so you can inspect them quickly.

Is my SAML data sent to a server?

No. Decoding happens entirely in your browser using JavaScript and nothing is uploaded. A decoded assertion can still contain personal data and session identifiers, so avoid pasting it into chats, tickets or other tools.

Why is my SAML payload URL-encoded?

When SAML messages are sent via HTTP Redirect binding, they travel in the URL query string. Characters like plus signs and equals signs must be percent-encoded to remain valid in a URL.

Can this tool decode deflated SAML messages?

Yes. If the Base64 bytes are not XML, the tool inflates them as raw DEFLATE, which is what the HTTP Redirect binding uses, and it also accepts the zlib-wrapped variant some senders produce by mistake. Data larger than 8 MB after decompression is refused.

What is the difference between SAMLRequest and SAMLResponse?

A SAMLRequest is sent by the service provider to initiate authentication. A SAMLResponse is returned by the identity provider containing the assertion. Both use the same base64 encoding and can be pasted into this saml decoder.

Why does the decoded XML look different from what I expected?

The tool re-indents the XML so each element is on its own line. Element order, attributes and text are unchanged, but the original whitespace between elements is not preserved.

Does this tool verify the XML signature?

No. It decodes and displays the message and reports whether a Signature element is present, but it never checks the signature, the certificate or the timestamps against the clock. Validation belongs in your SAML library with the identity provider certificate.

Can I use this as a SAML response decoder?

Yes. Paste the SAMLResponse value, in base64 or URL-encoded form, and the tool decodes it to XML and lists the status, NameID, attributes, audience and validity times. It does not verify the signature.

How do I view the attributes in a SAML assertion?

Decode the response and read the Attributes row of the summary, or search the formatted XML for AttributeStatement. Encrypted assertions show only that encrypted content is present.