Base64
Encodes text to Base64 and decodes back. Supports RFC 4648 standard and URL-safe variant; UTF-8 preserves Cyrillic and Unicode.
01
Encoder
02
How it works
3 input bytes → 4 Base64 chars. Example: 'Hi' → SGk=64 characters + = (padding for alignment)
A0
B1
C2
D3
E4
F5
G6
H7
I8
J9
K10
L11
M12
N13
O14
P15
Q16
R17
S18
T19
U20
V21
W22
X23
Y24
Z25
a26
b27
c28
d29
e30
f31
g32
h33
i34
j35
k36
l37
m38
n39
o40
p41
q42
r43
s44
t45
u46
v47
w48
x49
y50
z51
052
153
254
355
456
557
658
759
860
961
+62
/63
=pad
03
About Base64
Base64 is a byte-to-text encoding scheme. Every 3 input bytes become 4 characters from a set of 64 safe ASCII symbols. Output is ~33% larger than input.
The purpose of Base64 is to reliably transmit arbitrary data over text-only channels: email, JSON, XML, CSS, HTTP headers. It is not encryption — anyone can decode it back.
Standard Base64
RFC 4648Hello → SGVsbG8=
Alphabet of 64 characters: A–Z, a–z, 0–9, + and /. If the input length is not a multiple of 3, the result is padded with = characters. Used in MIME, PEM certificates, Base64 strings in HTML.
URL-safe Base64
RFC 4648 §5Hello → SGVsbG8 (no padding)
Modification for URLs and file names: + → −, / → _. Prevents conflicts with URL syntax. Used in JWT tokens, OAuth, Google API.
Character encoding
UTF-8: Cyrillic → 2 bytes per character
Base64 operates on bytes, not characters. UTF-8 preserves all Unicode (Cyrillic, CJK, emoji); Latin-1 only handles ASCII 0–255 — Cyrillic gets lost.
Where it's used
JWT · Data URI · SMTP · PEM · CSS · JSON API
Data URI — embedding images in HTML/CSS: src="data:image/png;base64,…". JWT — URL-safe Base64 header/payload. SMTP — email attachments. PEM — SSL certificates and keys.
04
Frequently asked questions
Updated