Skip to content

SAML Decoder

Embed

Paste this where you want SAML Decoder on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/saml-decoder/" width="100%" height="500" frameborder="0" loading="lazy" title="SAML Decoder"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/saml-decoder/">SAML Decoder</a> by BrowserUtils</p>

Decode SAML responses and assertions.Runs in this tab.

How to use SAML Decoder

  1. Paste a Base64 SAML request or response into Encoded SAML. A Redirect-binding value can stay URL-encoded. The same box handles both.
  2. Leave Auto-inflate (decompress deflated SAML) on unless you already know the message is Base64 only. Turn it off to skip the inflate attempt.
  3. Read Decoded XML. If inflate fails, the decoder shows the Base64-decoded bytes instead.

POST binding vs Redirect binding

SAML messages pass through the browser in one of two encodings. What you paste depends on which one you captured:

Binding Where it appears Encoding
HTTP-POST SAMLResponse field of an auto-submitting form, POSTed to the SP’s ACS URL Base64
HTTP-Redirect SAMLRequest query parameter on the redirect to the IdP, plus logout messages Raw DEFLATE, then Base64, then URL-encoding

Login responses arrive by POST (or, rarely, the Artifact binding), because the Web Browser SSO profile forbids Redirect for them. AuthnRequests and logout messages often go via Redirect.

One setting handles both. With Auto-inflate on (the default), the decoder:

  1. URL-decodes the input if it contains %.
  2. Base64-decodes it.
  3. Tries raw DEFLATE, falling back to the plain decoded bytes if that fails.
  4. Indents the resulting XML.

Line-wrapped Base64 is fine. Here’s a Redirect-binding value copied straight from the URL (truncated):

fZJLT8MwEIT%2FSuR7XkWAsJJIoRWiUoGoDRy4oCVZWkt%2BBO8Gyr8nTUEtB3qdnc%2Bzo3VGYHQny543donvPRIHW6MtyXGQi95b6YAUSQsGSXIjV%2BXd…

It decodes to:

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="_a91c3e" Version="2.0" IssueInstant="2026-11-01T17:02:05Z" Destination="https://idp.example.org/sso" AssertionConsumerServiceURL="https://app.example.com/saml/acs" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST">
  <saml:Issuer>
    https://app.example.com/saml/metadata
  </saml:Issuer>
  <samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress" AllowCreate="true"/>
</samlp:AuthnRequest>

Gotchas:

  • Paste only the parameter value. If you include the whole URL or a trailing &RelayState=…, the Base64 step fails.
  • Binary garbage means the data is still compressed. Turn Auto-inflate back on. If the output is still garbage and starts with x, the sender used zlib-wrapped deflate instead of the raw DEFLATE the spec calls for. Python’s zlib.decompress(data) (without -15) reads that format.
  • The formatter puts element text on its own indented line, like the Issuer above. Trim the whitespace when you copy a value to compare it with your config.
  • Don’t verify signatures against this view. Re-indenting changes whitespace that the XML signature covers, so use the raw decoded bytes.
  • <saml:EncryptedAssertion> means the assertion is encrypted to the SP’s key. This tool doesn’t decrypt it, so check the SP’s logs or the IdP’s logs instead.

Capturing the SAMLResponse

Open the Network tab in DevTools and enable Preserve log (in Firefox, Persist Logs in the Network settings). You need it because the POST to the ACS URL is followed immediately by a redirect that clears the list. Sign in, find the POST to your ACS endpoint, and copy SAMLResponse from the Payload tab (the Request tab in Firefox). The decoder accepts both the parsed value and the URL-encoded one. The SAML-tracer extension for Firefox and Chrome logs and decodes every SAML message in a flow, which helps when several redirects are involved.

Fields to check when SSO fails

Field Must match Typical error
Response/@Destination, SubjectConfirmationData/@Recipient The SP’s ACS URL exactly, including scheme, port and trailing slash Invalid destination or recipient
Issuer The IdP entity ID configured at the SP Unknown issuer
Audience The SP’s entity ID Audience restriction failed
Conditions/@NotBefore, @NotOnOrAfter Current UTC time, within the SP’s allowed clock skew Not yet valid / expired
@InResponseTo The ID of the AuthnRequest the SP sent (absent for IdP-initiated logins) Unsolicited response
StatusCode/@Value urn:oasis:names:tc:SAML:2.0:status:Success Requester or Responder. The nested code (e.g. InvalidNameIDPolicy) gives the reason
NameID and its Format What the SP looks users up by (emailAddress, persistent…) Wrong or duplicate account
ds:X509Certificate The signing certificate the SP has on file Bad signature after the IdP rotates its certificate

SAML timestamps are always UTC, so compare them with date -u +%Y-%m-%dT%H:%M:%SZ, not your local clock. The SubjectConfirmationData/@NotOnOrAfter window is usually a few minutes, so a captured response you replay later will fail. The SSL certificate decoder accepts the bare Base64 from X509Certificate and shows its subject and expiry.

Command-line equivalent

# HTTP-POST: Base64 only
printf '%s' "$SAMLResponse" | base64 -d | xmllint --format -

# HTTP-Redirect: URL-decode, Base64-decode, raw inflate (-15 = no zlib header)
python3 -c 'import sys, zlib, base64, urllib.parse as u; print(zlib.decompress(base64.b64decode(u.unquote(sys.argv[1])), -15).decode())' "$SAMLRequest"

# Pull out one field
printf '%s' "$SAMLResponse" | base64 -d | xmllint --xpath 'string(//*[local-name()="Conditions"]/@NotOnOrAfter)' -

Use unquote, not unquote_plus. + is a valid Base64 character, and turning it into a space corrupts the data.

Keep assertions on your machine

A SAML response contains names, email addresses and group memberships. Until its NotOnOrAfter time passes, a captured bearer assertion may also be replayable. This decoder runs entirely in the page using the browser’s atob and DecompressionStream, and makes no network request with your input. Use it or the commands above rather than a server-side decoder, and scrub real values before you paste XML into a ticket. If a parameter was URL-encoded twice, run it through the URL decoder once first. For OIDC ID tokens, use the JWT decoder.

Next step

Questions

How do I decode a SAML request online?
Paste the SAMLRequest value. Redirect binding is URL-encoded, then Base64, then raw DEFLATE. Leave Auto-inflate on. The decoder URL-decodes when the text contains %, Base64-decodes, then tries raw inflate.
How do I decode a SAML response?
Paste the SAMLResponse value from the POST body. POST binding is Base64 only. Auto-inflate still works: if raw inflate fails, you get the decoded XML from the Base64 bytes. Request and response use the same controls.
What is SAML?
SAML (Security Assertion Markup Language) is the XML format an identity provider and a service provider use for login. A request asks the identity provider to authenticate. A response carries the assertion back.
Where do I copy the encoded value from?
In the browser network log, a POST binding shows a SAMLResponse form field. A Redirect binding shows SAMLRequest on the query string. Paste that value here. The guide below covers what to look at when the login fails.

More in Encoding & Decoding

All 20 encoding & decoding