SAML Decoder and Encoder
Decode SAMLRequest and SAMLResponse values from Redirect (deflated) or POST bindings, see issuer, audience and timestamps, and encode XML for either binding.
The interactive tool loads here when JavaScript runs.
About this toolWhat is SAML Decoder?
The SAML Decoder turns an encoded SAMLRequest or SAMLResponse back into XML and summarises the fields that matter when single sign-on breaks: message type, ID, IssueInstant, Issuer, Destination, AssertionConsumerServiceURL, InResponseTo, StatusCode, NameID, Audience and the NotBefore and NotOnOrAfter conditions. It also tells you whether a Signature element is present and whether the assertion is encrypted.
Paste the bare value, a SAMLRequest=... pair, or a whole redirect URL copied from the browser's address bar or a HAR file. The tool URL-decodes, Base64-decodes and then decides which binding was used: plain XML means HTTP-POST, raw DEFLATE data means HTTP-Redirect. Encode works the other way and gives you both forms of the XML you paste.
Decoding and encoding happen in your browser. The tool does not verify XML signatures or decrypt EncryptedAssertion elements, which need the IdP certificate and the service provider's private key.
- Auto-detects HTTP-Redirect (DEFLATE) and HTTP-POST (Base64) values
- Accepts bare values, SAMLRequest= pairs and whole redirect URLs
- Summary of issuer, audience, status, NameID and time conditions
- Encodes XML for both bindings without altering signed content
- UTF-8 safe; runs entirely in the browser
Updated
How to use SAML Decoder
- Copy the SAMLRequest or SAMLResponse value from the browser (DevTools Network tab, a SAML tracer extension or a HAR file). A full redirect URL also works.
- Paste it into SAML Input and click Decode. The Decoded tab shows the XML and the Message summary shows the detected encoding and key fields.
- To build a test message, click Sample Request or Sample Response, edit the XML and click Encode.
- Copy the HTTP-POST value for a form field or the HTTP-Redirect value for a ?SAMLRequest= query string from the Encoded tab.
Worked examples
A redirect-binding AuthnRequest
Input
https://idp.example.com/sso?SAMLRequest=fZBNC4JAEIb%2FiuxdXTWCBl0Q...&RelayState=x
Output
Encoding: HTTP-Redirect (SAMLRequest); Type AuthnRequest; ID _abc123; Issuer https://sp.example.com; Destination https://idp.example.com/sso
The value was URL-decoded, Base64-decoded and inflated. The old version of this tool skipped the inflate step and showed binary noise for every Redirect-binding message.
Encoding a sample Response
Input
Sample Response XML, then Encode
Output
An HTTP-POST Base64 value starting PD94bWwg and a shorter URL-encoded HTTP-Redirect value
PD94bWwg is the Base64 of "<?xml ", a quick way to recognise a POST-binding value at a glance. The Redirect value is shorter because it is compressed.
Background and insight
The SAML 2.0 Bindings specification (OASIS, 2005) defines how messages travel. HTTP-Redirect puts the message in a URL query parameter, so it compresses the XML with raw DEFLATE (RFC 1951, without a zlib header), Base64-encodes it and URL-encodes the result. HTTP-POST puts plain Base64 XML in a hidden form field that the browser auto-submits. AuthnRequests often use Redirect; Responses almost always use POST because signed assertions are too large for a URL.
That difference is the most common decoding mistake. Running a Redirect value through a plain Base64 decoder gives binary noise, because the bytes are still compressed. A second one is the plus sign: Base64 uses +, and a form or query parser that treats + as a space corrupts the value. The decoder restores those spaces to + before decoding.
Signed SAML uses XML Signature, which is sensitive to every byte inside the signed element. Pretty-printing a signed Response and re-encoding it will make signature validation fail, so the encoder sends your XML exactly as entered, and the decoder only reformats XML for display when it arrives on a single line.
Common use cases
Debugging a failed SSO login
Check Destination, Audience, InResponseTo and the time conditions against what the service provider expects.
Onboarding a new IdP
Inspect the first SAMLResponse from Okta, Entra ID, Google or ADFS to confirm the NameID format and attribute names.
Writing integration tests
Encode hand-edited AuthnRequests for either binding to drive a test IdP.
Support tickets
Decode a value a customer pasted from a HAR file to see the status code the IdP returned.
Tips and limitations
- If NotOnOrAfter is a few seconds in the past, suspect clock skew between servers before anything else.
- Audience must match the SP entity ID exactly, including trailing slashes and http versus https.
- A Signature element being present does not mean it is valid. Verify signatures with a maintained SAML library, never with string checks.
- SAML responses can contain personal data such as email addresses and names. Redact them before sharing decoded output.
- Use the X.509 Parser to read the IdP signing certificate from metadata after wrapping it in PEM lines.
Sources and further reading
- Bindings for the OASIS Security Assertion Markup Language (SAML) V2.0, OASIS. The HTTP-Redirect and HTTP-POST bindings
- Assertions and Protocols for the OASIS Security Assertion Markup Language (SAML) V2.0, OASIS. AuthnRequest, Response and assertion elements
- RFC 1951: DEFLATE Compressed Data Format Specification version 1.3, IETF
- XML Signature Syntax and Processing Version 1.1, W3C. Why any change inside a signed element breaks the signature
Frequently asked questions
How do I decode a SAMLResponse?
Paste the SAMLResponse value into the input box and click Decode. The tool URL-decodes it if needed, Base64-decodes it, inflates it if it was deflated, and shows the XML with a summary of the issuer, status, NameID, audience and validity window.
Why does my decoded SAMLRequest look like binary garbage?
Because it came from the HTTP-Redirect binding, which DEFLATE-compresses the XML before Base64 encoding. A plain Base64 decoder leaves it compressed. This decoder detects that and inflates it, and it also reports which binding the value used.
What is the difference between the SAML HTTP-Redirect and HTTP-POST bindings?
HTTP-Redirect sends the message in a URL query parameter, so it is DEFLATE-compressed, Base64-encoded and URL-encoded. HTTP-POST sends plain Base64 XML in an auto-submitted form field. Requests often use Redirect; signed responses almost always use POST.
Does this SAML tool validate the signature?
No. It shows whether a Signature element is present but does not check it, because correct validation needs the IdP certificate, canonicalisation and defences against signature-wrapping attacks. Use your SAML library or the IdP's test tools for that.
Why does my SAML response fail validation after I edited and re-encoded it?
XML signatures cover the exact bytes of the signed element, including whitespace and attribute values. Any edit, even reformatting, invalidates the signature. This encoder does not reformat your XML, but editing a signed message will always break its signature.
Is it safe to paste production SAML responses here?
Decoding happens in your browser and nothing is uploaded. Responses can still contain names, emails and group memberships, so treat the decoded XML as personal data. An assertion is normally only accepted once and for a few minutes, which limits replay risk from a copied value.
Is there an in-depth guide to SAML Decoder?
Yes. “Debugging SAML SSO: Decoding Requests, Responses and Bindings” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.