import base64
coded_string = '''Q5YACgA...'''
base64.b64decode(coded_string)

worked for me. At the risk of pasting an offensively-long result, I got:

>>> base64.b64decode(coded_string)
2: 'C\x96\x00\n\x00\x00\x00\x00C\x96\x00\x1b\x00\x00\x00\x00C\x96\x00-\x00\x00\x00\x00C\x96\x00?\x00\x00\x00\x00C\x96\x07M\x00\x00\x00\x00C\x96\x07_\x00\x00\x00\x00C\x96\x07p\x00\x00\x00\x00C\x96\x07\x82\x00\x00\x00\x00C\x96\x07\x94\x00\x00\x00\x00C\x96\x07\xa6Cq\xf0\x7fC\x96\x07\xb8DJ\x81\xc7C\x96\x07\xcaD\xa5\x9dtC\x96\x07\xdcD\xb6\x97\x11C\x96\x07\xeeD\x8b\x8flC\x96\x07\xffD\x03\xd4\xaaC\x96\x08\x11B\x05&\xdcC\x96\x08#\x00\x00\x00\x00C\x96\x085C\x0c\xc9\xb7C\x96\x08GCy\xc0\xebC\x96\x08YC\x81\xa4xC\x96\x08kC\x0f@\x9bC\x96\x08}\x00\x00\x00\x00C\x96\x08\x8e\x00\x00\x00\x00C\x96\x08\xa0\x00\x00\x00\x00C\x96\x08\xb2\x00\x00\x00\x00C\x96\x86\xf9\x00\x00\x00\x00C\x96\x87\x0b\x00\x00\x00\x00C\x96\x87\x1d\x00\x00\x00\x00C\x96\x87/\x00\x00\x00\x00C\x96\x87AA\x0b\xe7PC\x96\x87SCI\xf5gC\x96\x87eC\xd4J\xeaC\x96\x87wD\r\x17EC\x96\x87\x89D\x00F6C\x96\x87\x9bC\x9cg\xdeC\x96\x87\xadB\xd56\x0cC\x96\x87\xbf\x00\x00\x00\x00C\x96\x87\xd1\x00\x00\x00\x00C\x96\x87\xe3\x00\x00\x00\x00C\x96\x87\xf5\x00\x00\x00\x00C\x9cY}\x00\x00\x00\x00C\x9cY\x90\x00\x00\x00\x00C\x9cY\xa4\x00\x00\x00\x00C\x9cY\xb7\x00\x00\x00\x00C\x9cY\xcbC\x1f\xbd\xa3C\x9cY\xdeCCz{C\x9cY\xf1CD\x02\xa7C\x9cZ\x05C+\x9d\x97C\x9cZ\x18C\x03R\xe3C\x9cZ,\x00\x00\x00\x00C\x9cZ?
[stuff omitted as it exceeded SO's body length limits]
\xbb\x00\x00\x00\x00D\xc5!7\x00\x00\x00\x00D\xc5!\xb2\x00\x00\x00\x00D\xc7\x14x\x00\x00\x00\x00D\xc7\x14\xf6\x00\x00\x00\x00D\xc7\x15t\x00\x00\x00\x00D\xc7\x15\xf2\x00\x00\x00\x00D\xc7\x16pC5\x9f\xf9D\xc7\x16\xeeC[\xb5\xf5D\xc7\x17lCG\x1b;D\xc7\x17\xeaB\xe3\x0b\xa6D\xc7\x18h\x00\x00\x00\x00D\xc7\x18\xe6\x00\x00\x00\x00D\xc7\x19d\x00\x00\x00\x00D\xc7\x19\xe2\x00\x00\x00\x00D\xc7\xfe\xb4\x00\x00\x00\x00D\xc7\xff3\x00\x00\x00\x00D\xc7\xff\xb2\x00\x00\x00\x00D\xc8\x001\x00\x00\x00\x00'
Answer from Blair Conrad on Stack Overflow
🌐
Python
docs.python.org › 3 › library › base64.html
base64 — Base16, Base32, Base64, Base85 Data Encodings
This module provides functions for encoding binary data to printable ASCII characters and decoding such encodings back to binary data. This includes the encodings specified in RFC 4648 (Base64, Base32 and Base16), the Base85 encoding specified ...
Top answer
1 of 10
450
import base64
coded_string = '''Q5YACgA...'''
base64.b64decode(coded_string)

worked for me. At the risk of pasting an offensively-long result, I got:

>>> base64.b64decode(coded_string)
2: 'C\x96\x00\n\x00\x00\x00\x00C\x96\x00\x1b\x00\x00\x00\x00C\x96\x00-\x00\x00\x00\x00C\x96\x00?\x00\x00\x00\x00C\x96\x07M\x00\x00\x00\x00C\x96\x07_\x00\x00\x00\x00C\x96\x07p\x00\x00\x00\x00C\x96\x07\x82\x00\x00\x00\x00C\x96\x07\x94\x00\x00\x00\x00C\x96\x07\xa6Cq\xf0\x7fC\x96\x07\xb8DJ\x81\xc7C\x96\x07\xcaD\xa5\x9dtC\x96\x07\xdcD\xb6\x97\x11C\x96\x07\xeeD\x8b\x8flC\x96\x07\xffD\x03\xd4\xaaC\x96\x08\x11B\x05&\xdcC\x96\x08#\x00\x00\x00\x00C\x96\x085C\x0c\xc9\xb7C\x96\x08GCy\xc0\xebC\x96\x08YC\x81\xa4xC\x96\x08kC\x0f@\x9bC\x96\x08}\x00\x00\x00\x00C\x96\x08\x8e\x00\x00\x00\x00C\x96\x08\xa0\x00\x00\x00\x00C\x96\x08\xb2\x00\x00\x00\x00C\x96\x86\xf9\x00\x00\x00\x00C\x96\x87\x0b\x00\x00\x00\x00C\x96\x87\x1d\x00\x00\x00\x00C\x96\x87/\x00\x00\x00\x00C\x96\x87AA\x0b\xe7PC\x96\x87SCI\xf5gC\x96\x87eC\xd4J\xeaC\x96\x87wD\r\x17EC\x96\x87\x89D\x00F6C\x96\x87\x9bC\x9cg\xdeC\x96\x87\xadB\xd56\x0cC\x96\x87\xbf\x00\x00\x00\x00C\x96\x87\xd1\x00\x00\x00\x00C\x96\x87\xe3\x00\x00\x00\x00C\x96\x87\xf5\x00\x00\x00\x00C\x9cY}\x00\x00\x00\x00C\x9cY\x90\x00\x00\x00\x00C\x9cY\xa4\x00\x00\x00\x00C\x9cY\xb7\x00\x00\x00\x00C\x9cY\xcbC\x1f\xbd\xa3C\x9cY\xdeCCz{C\x9cY\xf1CD\x02\xa7C\x9cZ\x05C+\x9d\x97C\x9cZ\x18C\x03R\xe3C\x9cZ,\x00\x00\x00\x00C\x9cZ?
[stuff omitted as it exceeded SO's body length limits]
\xbb\x00\x00\x00\x00D\xc5!7\x00\x00\x00\x00D\xc5!\xb2\x00\x00\x00\x00D\xc7\x14x\x00\x00\x00\x00D\xc7\x14\xf6\x00\x00\x00\x00D\xc7\x15t\x00\x00\x00\x00D\xc7\x15\xf2\x00\x00\x00\x00D\xc7\x16pC5\x9f\xf9D\xc7\x16\xeeC[\xb5\xf5D\xc7\x17lCG\x1b;D\xc7\x17\xeaB\xe3\x0b\xa6D\xc7\x18h\x00\x00\x00\x00D\xc7\x18\xe6\x00\x00\x00\x00D\xc7\x19d\x00\x00\x00\x00D\xc7\x19\xe2\x00\x00\x00\x00D\xc7\xfe\xb4\x00\x00\x00\x00D\xc7\xff3\x00\x00\x00\x00D\xc7\xff\xb2\x00\x00\x00\x00D\xc8\x001\x00\x00\x00\x00'
2 of 10
224

Python 3 (and 2)

import base64
a = 'eW91ciB0ZXh0'
base64.b64decode(a)

Python 2

A quick way to decode it without importing anything:

'eW91ciB0ZXh0'.decode('base64')

or more descriptive

>>> a = 'eW91ciB0ZXh0'
>>> a.decode('base64')
'your text'
🌐
GeeksforGeeks
geeksforgeeks.org › python › encoding-and-decoding-base64-strings-in-python
Encoding and Decoding Base64 Strings in Python - GeeksforGeeks
August 7, 2024 - Decoding Base64 string is exactly opposite to that of encoding. First we convert the Base64 strings into unencoded data bytes followed by conversion into bytes-like object into a string.
🌐
Bacancy Technology
bacancytechnology.com › qanda › python › decode-base64-data-in-python
How to Decode Base64 Data in Python Easily
June 24, 2025 - import base64 # Your Base64-encoded string b64_data = 'ABCSSDURN' # Convert to bytes, if it's a string decoded_bytes = base64.b64decode(b64_data) # If the original data was text, decode to string try: decoded_string = decoded_bytes.decode('utf-8') print(decoded_string) except UnicodeDecodeError: print("Decoded data is binary, not UTF-8 text.")
🌐
GitHub
github.com › mayeut › pybase64
GitHub - mayeut/pybase64: Fast Base64 encoding/decoding in Python · GitHub
May 16, 2026 - It aims to provide a fast base64 implementation for base64 encoding/decoding. ... pybase64 uses the same API as Python base64 "modern interface" (introduced in Python 2.4) for an easy integration.
Starred by 181 users
Forked by 20 users
Languages   Python 63.6% | C 36.4%
🌐
W3Schools
w3schools.com › python › ref_module_base64.asp
Python base64 Module
Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp Python Training · ❮ Standard Library Modules · Encode and decode a string using Base64: import base64 s = "Linus".encode() b = base64.b64encode(s) print(b) print(base64.b64decode(b).decode()) Try it Yourself » ·
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › decode a base64 py code
r/learnpython on Reddit: Decode a base64 py code
January 9, 2026 -

Hi how can I decrupt a long chunk of encoded base 64 multi layer py script like in general

I m also not coder or from this field, just lost the original source of the script and want to recover from this

🌐
Base64Encode.org
base64encode.org › enc › python
Base64 Encoding of "python" - Online
Encode python to Base64 format with various advanced options. Our site has an easy to use online tool to convert your data.
🌐
Medium
medium.com › personal-work-revision › how-to-decode-base64-encoded-88b2c08ba64c
How to Decode base64 Encoded with Python ? | by Pelin R. Kuran | Personal Work Revision | Medium
October 28, 2020 - In this article we will be trying to decode base64 encoded string object of a JSON file with the great Python also as a bonus I will show how to get your JSON data in a web service. Before starting I…
🌐
Base64 Decode
base64decode.org
Base64 Decode and Encode - Online
Decode from Base64 format or encode into it with various advanced options. Our site has an easy to use online tool to convert your data.
🌐
Envato Tuts+
code.tutsplus.com › home › coding fundamentals › oop
Base64 Encoding and Decoding Using Python | Envato Tuts+
April 11, 2022 - Thus, we can do the following in order to Base64 encode our image: If you want to see the output of the encoding process, type the following: ... To decode an image using Python, we simply use the base64.b64decode(s) function.
🌐
Medium
medium.com › @shokomelu › a-python-script-to-decode-base64-encoded-data-566982b7cb18
A Python script to decode Base64-encoded data | by Melusi shoko | Medium
November 30, 2023 - The example usage demonstrates how to decode a Base64 string using the decode_base64 function and then print the decoded string. In this case, the Base64 string "SGVsbG8gV29ybGQh" is decoded to "Hello World!". You can replace the base64_string ...
🌐
Medium
medium.com › geekculture › base64-encoding-and-decoding-in-python-d9b1ede042d1
Base64 Encoding and Decoding in Python | by Yancy Dennis | Geek Culture | Medium
February 22, 2023 - Python provides a built-in library called base64 that can be used for encoding and decoding messages in Base64 format.
🌐
Python Engineer
python-engineer.com › posts › base64-module
The base64 Module in Python - Python Engineer
June 21, 2022 - Decoding base64 string is opposite to that of encoding. The base64 module provides the b64decode() function which decodes the Base64 encoded bytes-like object or ASCII string and returns the decoded bytes.
🌐
Educative
educative.io › answers › how-to-use-base64b64decode-in-python
How to use base64.b64decode() in Python
The program then encodes the bytes in base64 and specifies in the altchars argument that / or + is to be encoded with :. To check the correctness of the encoding, the program decodes the encoded data using the base64.b64decode() function.
🌐
Codemia
codemia.io › home › knowledge hub › how do you decode base64 data in python?
How do you decode Base64 data in Python? | Codemia
September 23, 2025 - 1import base64 2 3encoded = b"UHl0aG9u" 4decoded = base64.b64decode(encoded) 5 6print(decoded.decode("utf-8")) That is useful when the payload comes directly from a network response or file read operation. Some systems use URL-safe Base64, where - and _ replace the standard + and / characters. Python supports that with urlsafe_b64decode.
🌐
Base64.Guru
base64.guru › converter › decode
Base64 Decode | Base64 Converter | Base64
Thanks to it, this converter allows you to “decrypt” some Base64 strings, even while other online or offline decoders are powerless and cannot decode them, because they support only the “main” standard.
🌐
DEV Community
dev.to › tooldeck › base64-decode-in-python-complete-guide-b64decode-urlsafe-padding-fix-3ph7
Base64 Decode in Python — Complete Guide (b64decode, urlsafe, padding fix) - DEV Community
March 25, 2026 - This guide covers base64.b64decode(), urlsafe_b64decode(), automatic padding repair, decoding from files and HTTP responses, CLI tools, input validation, and four common mistakes with before/after fixes — all runnable Python 3.8+ examples.
🌐
Cybrosys Technologies
cybrosys.com › odoo blogs
Base64 Encoding & Decoding Using Python
July 18, 2023 - The Python base64 module provides an easy way to encrypt and decrypt binary data using the Base64 encoding technique. It is also extremely simple to use.