ManyHand logoManyHand ← All tools

Base64 Encoder & Decoder

Text ⇄ Base64 and image ⇄ Base64 data URI — in your browser, nothing uploaded.

Plain text
Base64

How to encode and decode Base64

What Base64 is

Base64 is a way of writing any data — text, an image, a file — using only 64 safe characters: A–Z, a–z, 0–9, plus + and /. It exists because many systems were built to carry plain text and would corrupt raw bytes. Email attachments, JSON payloads, HTML and CSS files, and HTTP headers all rely on it.

It works by taking the data three bytes at a time, which is 24 bits, and cutting those into four groups of six bits. Each group, a number from 0 to 63, becomes one character. When the data does not divide evenly by three, = signs pad the end.

TextBase64Note
ManTWFuThree bytes become four characters
HiSGk=Two bytes, one = of padding
AQQ==One byte, two = of padding

Base64 is not encryption

Anyone can decode Base64 in a second; it hides nothing. A password or API key that is “only Base64 encoded” is exposed. It is an encoding for transport, not a way to protect secrets. To check integrity use a hash, and to store passwords use a password hash.

It makes data a third bigger

Four characters for every three bytes means Base64 output is about 33% larger than the original. A 30 KB image becomes roughly 40 KB of text. That is the price of making it safe to paste anywhere.

When to embed an image as a data URI

A data URI looks like data:image/png;base64,iVBORw0… and can go wherever an image address would, in an img tag or a CSS background. It saves a network request, which helps for tiny icons and for single-file HTML emails or documents.

For larger images it is the wrong choice. The file gets bigger, the browser cannot cache it separately from the page, and the HTML or CSS around it becomes slow to load and awkward to edit. As a rule of thumb, embed only images of a few kilobytes, and shrink them first with the Image Compressor.

Variants you may meet

URL-safe Base64 replaces + and / with - and _ and often drops the padding, so that the result can sit in a web address; JSON Web Tokens use it, and the JWT Decoder reads them. This tool handles text as UTF-8, so accented letters, Indian scripts and emoji survive a round trip.

About & FAQ

Encode text to Base64 or decode it back, and convert images to Base64 data URIs for embedding in HTML/CSS (or decode a data URI back to an image). It is UTF-8 safe and runs entirely in your browser, so nothing you paste is uploaded.

How do I encode text to Base64?

Type in the Plain text box; the Base64 appears live. Paste into the Base64 box to decode.

Does it handle emojis and accents?

Yes — it is UTF-8 safe, so 🎉 and café encode and decode correctly.

Is anything uploaded?

No. Everything runs locally in your browser.

More tools: QR Code Generator · Image Compressor