Base64 encode and decode online

Paste text or Base64 and the result updates as you type. The tool detects which direction you need, handles URL-safe and MIME variants, and encodes files you drop in. Nothing is uploaded.

Detects the direction automatically
Input
Drop any file here to encode it.
Base64
The result appears here. Try an example:
UTF-8 · waiting for inputCtrlEntercopy result

How to encode or decode Base64

  1. 1Type or paste into Input, or drop a file onto it. Plain text is encoded; a valid Base64 string is decoded.
  2. 2If Auto picks the wrong direction, choose Encode or Decode. Turn on URL-safe, No padding or Wrap 76 to match the format you need.
  3. 3Copy the result, download it as a file, or press Swap to run it back the other way.

What is Base64?

Base64 is a way to write binary data using only 64 printable characters. Every 3 bytes of input become 4 characters of output, so the encoded text is about 33% larger than the original. It is used wherever a system only accepts text: email attachments, data URIs in HTML and CSS, JSON payloads, HTTP Basic auth and JSON Web Tokens.

Each character stands for a 6-bit value from 0 to 63. When the input length isn’t a multiple of 3, one or two “=” characters pad the end.

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

Standard, URL-safe and MIME Base64

The decoder accepts all three variants automatically. When encoding, use the toggles above the input to choose one.

VariantDiffers byUsed in
Standard+ / =Data URIs, JSON, most APIs (RFC 4648)
URL-safe- _ , often no =URLs, filenames, JWT
MIMEline break every 76Email attachments, PEM certificates

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, and anyone can reverse it without a key. Use it to carry binary data through text-only channels, not to protect it. For secrecy, encrypt first and then Base64-encode the ciphertext.

Why does decoding fail?

The usual causes are a character outside the Base64 alphabet, padding “=” in the middle of the string, or a string that was cut off. The decoder highlights the exact position. Spaces and line breaks are ignored, and URL-safe input is accepted.

Why is the decoded result unreadable?

The Base64 probably holds binary data such as an image, a ZIP file or compressed bytes, not text. The tool shows a hex preview in that case. Download the result to get the original file, or use Base64 to image for pictures.

Which character encoding is used for text?

UTF-8 by default. Chinese, Japanese, emoji and other non-Latin characters round-trip correctly. For legacy Simplified Chinese data, choose GB2312 in the encoding menu. Strings encoded from UTF-16 or other code pages may decode to unexpected characters.

Are my text and files uploaded?

No. Encoding and decoding run in your browser with JavaScript. Nothing you type or drop is sent to a server.

More Base64 tools