block-quote On this pagechevron-down
copy Copy chevron-down
Liquid chevron-right Filters base64_decode Decodes a Base64-encoded string back to its original text. Useful for reading encoded API responses, decoding authentication tokens, or processing encoded webhook payloads.
Copy {% assign decoded = "SGVsbG8sIFdvcmxkIQ==" | base64_decode %}
{% log decoded %} Output:
Copy {{ base64_string | base64_decode }} The Base64-encoded string to decode
Decode API response data:
Copy {% http options : api_request as response %}
{% if response . body . encoded_data %}
{% assign decoded_data = response . body . encoded_data | base64_decode %}
{% assign parsed_data = decoded_data | parse %}
{% log "Decoded response:" %}
{% log parsed_data %}
{% endif %} Decode webhook payload:
Decode URL parameter data:
Decode Basic Auth header (for debugging):
Process encoded email content:
Decode international characters:
Output:
Decode and parse JSON from encoded parameter:
Handle URL-safe Base64:
Decode and validate signature data:
Decode embedded file content:
Encoding Round-Trip
Output:
Supports UTF-8 decoding (handles international characters correctly)
Expects standard Base64 input (with +, /, and = padding)
For URL-safe Base64, convert - to + and _ to / before decoding
Invalid Base64 input may produce unexpected results or empty output
Decoding does not validate the content - always validate decoded data before use
See also: base64_encode for encoding strings to Base64