Free forever · No sign-up
Base64 Decode
Decode any Base64 string back to text instantly — UTF-8 safe. Free, fast, no sign-up.
That doesn't look like valid Base64 — check for typos.
Your data stays in your browser.
No recent conversions yet.
Step-by-step calculation
| Base64 | Bytes | Text |
|---|
How Base64 decoding works
- Base64 text is split into groups of 4 characters.
- Each group becomes 3 bytes (6 bits per character).
- The bytes are read back as UTF-8 text.
Example: "SGk=" → 48 69 → "Hi".
Background reading: the Base64 encoding scheme on Wikipedia.
Base64 alphabet
The 64 characters of the Base64 alphabet and their 6-bit values (0–63) — decoding maps each character back to its value.
| Char | Value | Char | Value | Char | Value | Char | Value |
|---|---|---|---|---|---|---|---|
| A | 0 | B | 1 | C | 2 | D | 3 |
| E | 4 | F | 5 | G | 6 | H | 7 |
| I | 8 | J | 9 | K | 10 | L | 11 |
| M | 12 | N | 13 | O | 14 | P | 15 |
| Q | 16 | R | 17 | S | 18 | T | 19 |
| U | 20 | V | 21 | W | 22 | X | 23 |
| Y | 24 | Z | 25 | a | 26 | b | 27 |
| c | 28 | d | 29 | e | 30 | f | 31 |
| g | 32 | h | 33 | i | 34 | j | 35 |
| k | 36 | l | 37 | m | 38 | n | 39 |
| o | 40 | p | 41 | q | 42 | r | 43 |
| s | 44 | t | 45 | u | 46 | v | 47 |
| w | 48 | x | 49 | y | 50 | z | 51 |
| 0 | 52 | 1 | 53 | 2 | 54 | 3 | 55 |
| 4 | 56 | 5 | 57 | 6 | 58 | 7 | 59 |
| 8 | 60 | 9 | 61 | + | 62 | / | 63 |
Base64 decoding in code
Python
import base64
base64.b64decode("SGkg8J+Riw==").decode()
# → 'Hi 👋'
JavaScript
decodeURIComponent(escape(atob("SGkg8J+Riw==")));
// → 'Hi 👋'
C
/* C has no standard-library Base64 decoder. The usual approach
is the reverse of encoding:
1. Map each of the 4 input characters back to its 6-bit value
using the alphabet "ABC...Zabc...z0-9+/".
2. Regroup the 6-bit values into bytes: 4 chars -> 3 bytes.
3. Strip '=' padding. Example: "SGk=" -> S=18, G=6, k=36
-> bytes 0x48 0x69 -> "Hi". */
Common values
SGk=→ “Hi”TWFu→ “Man”QQ==→ “A”QUI=→ “AB”
Key takeaways
- Decoding reverses encoding: 4 Base64 characters → 3 bytes.
- Stray characters or bad padding cause ‘invalid Base64’ errors.
- Decoded bytes are not always text — they can be images or files.
- Base64 offers no security; treat decoded content with care.
Frequently asked questions
How do I decode Base64?
Paste the Base64 string above — the decoder handles the rest, including '=' padding.
Why does my Base64 end with '='?
'=' is padding added when the input length isn't a multiple of 3 bytes.
I get an error — why?
Base64 only uses A–Z, a–z, 0–9, +, / and '=' padding. Other characters mean the string is damaged or incomplete.
What does ‘invalid Base64’ mean?
The input contains characters outside the Base64 alphabet, or the padding is wrong — check for spaces or missing = signs.
Can I decode Base64 without padding?
Often yes — the decoder can infer missing = padding from the string length.
Why is my decoded text garbled?
It was probably encoded from raw bytes (like an image), not text — decoding those bytes as text gives mojibake.
Is decoding Base64 safe?
Decoding is safe, but the result can be anything — an image, a file, or text. Do not execute decoded content you do not trust.
Need to encode? Try our Base64 encoder.