Skip to content
The Base64 Alphabet
step 1/5

Reading — step 1 of 5

Read

~1 min readThe Basics

The Base64 Alphabet

64 characters representing 6-bit values:

IndexCharIndexCharIndexCharIndexChar
0-25A-Z26-51a-z52-610-962+
63/

Plus = for padding (NOT a value).

Standard mapping in code:

python

Why these chars? They're all ASCII printable + safe in most text contexts. The + and / are problematic in URLs (need percent-encoding) and filenames — see base64url variant later.

A faster approach: precomputed lookup tables.

python

For very fast encoding (gigabit/sec), specialized SIMD implementations exist — they look up 16 chars in parallel.

Discussion

Ask a question, share an insight, or help someone who’s stuck.

Sign in to post a comment or reply.

Loading…