Encode text or any file to Base64, or decode Base64 back to text, an image or a downloadable file. Emoji, accents and URL-safe Base64 all work.
Runs entirely in your browser. Nothing you type or upload is sent to a server.
How Base64 works
Computers store everything as bytes, and a byte can hold 256 different values. Many older systems, email above all, were built to carry only a narrow range of plain text characters and would mangle anything else. Base64 solves this by rewriting bytes using just 64 characters that survive everywhere.
It takes the input three bytes (24 bits) at a time and splits those bits into four groups of six. Six bits can hold 64 values, and each value maps to one character of the alphabet A–Z a–z 0–9 + /. The word "Man" is the classic example:
Text M a n
Bytes 01001101 01100001 01101110
6-bit 010011 010110 000101 101110
Values 19 22 5 46
Base64 T W F u → TWFuWhen the input is not a multiple of three bytes, the output is padded with one or two = signs so its length stays a multiple of four. Because three bytes become four characters, Base64 is always about a third larger than the original.
Where you will meet it
- Email attachments. Every photo or PDF you email travels as Base64 inside the message, wrapped at 76 characters per line.
- Data URIs.
data:image/png;base64,...embeds a file directly in HTML or CSS, saving a request for a tiny icon. - APIs and JSON. JSON has no binary type, so files and signatures are sent as Base64 strings.
- Web tokens. A JSON Web Token is three URL-safe Base64 sections separated by dots. The JWT Decoder reads them.
- HTTP Basic authentication. The header
Authorization: Basic dXNlcjpwYXNzis justuser:passin Base64, which is why Basic auth is only safe over HTTPS.
Recognizing Base64 by how it starts
Files begin with fixed signature bytes, so their Base64 begins with fixed characters too. With practice you can tell what a blob of Base64 holds at a glance:
| Starts with | It is |
|---|---|
iVBORw0KGgo | PNG image |
/9j/ | JPEG image |
R0lGOD | GIF image |
JVBERi0 | PDF document |
UEsDB | ZIP archive, including .docx, .xlsx and .apk files |
H4sI | Gzip-compressed data |
eyJ | JSON starting with {", very often a JSON Web Token |
Text, UTF-8 and the emoji problem
Base64 encodes bytes, not letters, so text has to be turned into bytes first, and the choice of encoding matters. This tool uses UTF-8, the encoding of almost the entire web. Many quick converters call the browser's btoa() directly, which only accepts characters from the Latin-1 range and fails on emoji, Chinese, Greek or curly quotes. Here, "Grüße 👋" encodes and decodes back exactly.
When not to use it
Base64 is not a security measure: it hides nothing from anyone who looks. It is also a poor way to ship large images on a website. A data URI makes the page a third heavier, cannot be cached separately and blocks the page while it downloads. Keep data URIs for icons of a few kilobytes and serve everything else as a normal file.

