Base64 encoding step by step

Đã xuất bản

Trong hướng dẫn này

This learning guide on Base64Encoding explains encode 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.

Thử các công cụ riêng tư tiếp theo

Let’s encode the word Hi! and then Hi (which needs padding) by hand.

Example 1: “Hi!” (3 bytes, no padding)

Step 1 — characters to bytes. Using the ASCII table:

Character H i !
Decimal 72 105 33
Binary 01001000 01101001 00100001

Step 2 — join the bits:

010010000110100100100001

Step 3 — split into 6-bit groups:

010010 | 000110 | 100100 | 100001
  18   |    6   |   36   |   33

Step 4 — look up each number in the Base64 alphabet: 18 → S, 6 → G, 36 → k, 33 → h.

Result: Hi! → SGkh

Example 2: “Hi” (2 bytes, one = pad)

H        i
01001000 01101001

16 bits do not fill 24. Split into 6-bit groups and pad the last group with zero bits:

010010 | 000110 | 1001(00)
  18   |    6   |   36
   S   |    G   |    k

Only three characters carry data; one = marks the missing byte.

Result: Hi → SGk=

Example 3: “H” (1 byte, two = pads)

010010 | 00(0000)
  18   |    0
   S   |    A

Result: H → SA==

Non-ASCII text

Characters such as é or € are first converted to bytes with a character encoding, usually UTF-8. é becomes two bytes (C3 A9), so é encodes to w6k=. Different encodings give different Base64: in Windows-1252, é is one byte (E9) and encodes to 6Q==. That is why the text encoder lets you choose the character set.

Next: decoding step by step.

Câu hỏi thường gặp

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 encode?

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

Công cụ và hướng dẫn liên quan

Bình luận (0)

Có câu hỏi, ý tưởng hoặc phát hiện lỗi trong “Base64 encoding step by step”? Hãy để lại bình luận, đánh giá công cụ hoặc trả lời người khác.

Chưa có bình luận nào. Hãy là người đầu tiên chia sẻ ý kiến!

Để lại bình luận

Đánh giá công cụ này:
Esc
↑ ↓ di chuyển↵ mởEsc đóng