Free forever · No sign-up

Base64 Decode

Decode any Base64 string back to text instantly — UTF-8 safe. Free, fast, no sign-up.

Last updated: October 2026

Your data stays in your browser.

Recent

No recent conversions yet.

How Base64 decoding works

  1. Base64 text is split into groups of 4 characters.
  2. Each group becomes 3 bytes (6 bits per character).
  3. 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.

CharValueCharValueCharValueCharValue
A0B1C2D3
E4F5G6H7
I8J9K10L11
M12N13O14P15
Q16R17S18T19
U20V21W22X23
Y24Z25a26b27
c28d29e30f31
g32h33i34j35
k36l37m38n39
o40p41q42r43
s44t45u46v47
w48x49y50z51
052153254355
456557658759
860961+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.

More converters