Skip to main content
zerouploads

base64 encode

Encoded in the page, so a token stays in your own tab.

Encoded as UTF-8 first, so accents and emoji survive the trip.

The short answer

Base64 rewrites bytes using sixty-four printable characters, so binary can travel through something that only understands text. It is an encoding, not encryption: anyone can read it back, so aGVsbG8= is not a way to hide anything.

Base64 lets binary travel through something that only understands text. This encodes as UTF-8 first, so accents and emoji come out the other side intact.

The formula

UTF-8 bytes → groups of three → four characters from a 64-symbol alphabet

Worked examples

"hello"
aGVsbG8=
"café"
Y2Fmw6k=
"a"
YQ==

Reference table

Padding is what the trailing = signs are
InputBytesBase64Padding
abc3YWJjnone
ab2YWI=one =
a1YQ==two ==
café5, not 4Y2Fmw6k=one =

How to use it

  1. 01Paste your textAnything, in any language. The output updates as you type.
  2. 02Copy the base64One button. Nothing is sent anywhere, which is the point when the text is a key or a token.

Also searched for

Searches that land here include base64 encode, text to base64, base64 encoder, encode base64 online and utf8 to base64.

What base64 is for

Moving bytes through a text-only pipe

Email headers, JSON, XML, URLs and cookies all expect text. Feed them raw bytes and something in the chain will reinterpret one as a control character or a line ending and quietly corrupt the payload. Base64 sidesteps that by using sixty-four characters every system agrees about, plus the equals sign for padding.

UTF-8 comes first

Text has to become bytes before it can become base64, and which bytes depends on the encoding. This page uses UTF-8, which is what the web has used for two decades. Tools that skip that step and encode character codes directly throw on anything outside Latin-1, which is why some encoders refuse an emoji.

Where you will meet it

Data URIs carrying a small image inside a stylesheet. The middle section of a JSON Web Token, which is base64 and therefore readable by anyone holding it. Attachments in an email. Certificates in PEM files. In all of those the encoding is there for transport, never for secrecy.

Questions people ask

Is base64 encryption?

No, and treating it as such is the most common mistake made with it. Anyone can decode base64 in a second, with no key and no effort. It hides nothing. It exists to move bytes safely through channels that expect text, not to keep them secret.

Why does my output end in = or ==?

Base64 works in groups of three bytes, which become four characters. When the input does not divide by three the last group is padded so the length still does: one leftover byte gives two equals signs, two leftover bytes give one. Some decoders accept the string without the padding.

Why is the base64 longer than my text?

Because it spends four characters describing every three bytes, so it is about a third larger. That is the cost of using only characters that survive email headers, URLs, JSON and everything else that would otherwise mangle raw bytes.