Base64 decoding step by step

Published

In this guide

This learning guide on Base64Encoding explains decode in plain language for developers and everyday users.

Everything important stays private: try the matching converter or tool in your browser — files and tokens are not uploaded.

Read the full English article below for code samples and edge cases, or switch language anytime from the menu. We keep expanding translations from real user feedback.

Try these private tools next

Decoding reverses the encoding steps. Let’s decode Q2F0 and Q2F0cw==.

Example 1: “Q2F0”

Step 1 — characters to values using the Base64 alphabet:

Character Q 2 F 0
Value 16 54 5 52
6-bit binary 010000 110110 000101 110100

Step 2 — join the bits and split into bytes (8 bits):

010000110110000101110100
01000011 | 01100001 | 01110100
   67    |    97    |   116

Step 3 — bytes to characters with the ASCII table: 67 → C, 97 → a, 116 → t.

Result: Q2F0 → Cat

Example 2: “Q2F0cw==” (with padding)

The first block decodes to Cat as above. The second block is cw==:

c       w
011100  110000

Two = mean this block holds only one byte. Take the first 8 of the 12 bits and discard the rest (which must be zeros in strict decoding):

01110011 | (0000)
   115 → "s"

Result: Q2F0cw== → Cats

What can go wrong

  • Invalid characters (spaces, -, _, %) have no value in the standard alphabet. Strict decoders stop; lenient ones skip them. Our validator shows their exact position.
  • Wrong length: a valid unpadded length is never 4n + 1, because one leftover character holds only 6 bits — not enough for a byte.
  • Non-zero leftover bits, like Q2F0cx==, are technically invalid but most decoders accept them and decode the same bytes.
  • Text looks garbled after decoding: the bytes are correct but displayed with the wrong character set. Use character encoding detection.

Try your own value with the Base64 decoder.

سؤالات متداول

Does this page upload my data?

No. Articles are static. Linked tools run locally in your browser unless a feature explicitly needs a network relay.

Can I request a translation or a new tool?

Yes — use the private feedback form. We prioritize what users ask for across languages.

What is the fastest way to try decode?

Open the homepage Base64 converter or the related tools linked on this page and paste a sample.

ابزارها و راهنماهای مرتبط

دیدگاه‌ها (0)

سؤال، ایده یا باگی در «Base64 decoding step by step» دارید؟ دیدگاه بگذارید، به ابزار امتیاز دهید یا به دیگران پاسخ دهید.

هنوز دیدگاهی ثبت نشده است. اولین نفری باشید که نظر خود را به اشتراک می‌گذارد!

دیدگاه بگذارید

به این ابزار امتیاز دهید:
Esc
↑ ↓ جابه‌جایی↵ باز کردنEsc بستن