

Your data is 100% private -- Base64 is fully encoded and decoded directly on your device.
Base64 is a way to represent binary data as plain text using 64 ASCII characters: A–Z, a–z, 0–9, plus + and /. It lets binary like images, keys, and email attachments travel safely through systems built for text. It is encoding, not encryption.
Base64 uses a fixed alphabet of 64 characters. Each value from 0 to 63 maps to exactly one of them, which is how any 3 bytes of binary become 4 readable characters:
| Values | Characters | |
|---|---|---|
| 0–25 | A–Z | 26 uppercase letters |
| 26–51 | a–z | 26 lowercase letters |
| 52–61 | 0–9 | 10 digits |
| 62–63 | + / | 2 symbols |
The "=" sign is the one exception. It is padding, not one of the 64 values, and only rounds out the last block.
You have almost certainly seen it already. Base64 shows up wherever binary needs to ride inside text:
That data-URI trick looks like this. The long string is the entire image:
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />Early network protocols were built for text, not raw bytes. ASCII used 7 bits and 128 characters, which was fine for English but not for binary. Some systems mangled control characters or rewrote line endings (LF to CR + LF), quietly corrupting images and audio in transit.
Base64 sidesteps all of that by only ever emitting characters every system already agrees on. Base16 and Base32 do the same job with smaller alphabets, but Base64 packs more data per character while staying safe. That is why it won.
The whole scheme is one idea on repeat: take 3 bytes (24 bits), re-slice them into four 6-bit groups, and look each group up in the alphabet. Here is the word "Logto", encoded by hand.
Step 1. Turn each character into its 8-bit binary:
| Character | ASCII code | Binary |
|---|---|---|
| L | 76 | 01001100 |
| o | 111 | 01101111 |
| g | 103 | 01100111 |
| t | 116 | 01110100 |
| o | 111 | 01101111 |
Step 2. Take the first three bytes, "Log", and re-slice those same 24 bits into four 6-bit groups:
Step 3. Read each 6-bit group as a number, then look the number up in the alphabet:
| 6-bit group | Value | Base64 character |
|---|---|---|
| 010011 | 19 | T |
| 000110 | 6 | G |
| 111101 | 61 | 9 |
| 100111 | 39 | n |
"Logto" is 5 bytes, not a multiple of 3. The last two bytes, "to", leave a 6 + 6 + 4 split. Pad those last 4 bits with zeros to fill a 6-bit group, then add one "=" to complete the 4-character block:
Put the blocks together:
"Logto" → TG9ndG8=Every language ships this built in. In Node.js:
const text = 'Logto';
const base64 = Buffer.from(text).toString('base64');
console.log(base64); // TG9ndG8=Three rules fall out of that process, worth keeping in mind:
Reach for Base64 when binary has to pass through a text-only channel:
What you get in return:
Standard Base64 leans on three characters that clash with how URLs, query strings, and filenames work: +, /, and the = padding. Drop a normal Base64 string into a link and it can break in quiet ways:
You can percent-encode them (+ becomes %2B, / becomes %2F, = becomes %3D), but that bloats the string and is easy to double-encode by mistake.
Base64URL (RFC 4648 §5) fixes this at the source: swap + for -, swap / for _, and drop the = padding. The result drops straight into a URL, query parameter, or filename with nothing to escape. You will see it in URLs, filenames, and many web APIs.
const base64 = 'TG9ndG8=';
const urlSafe = base64.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
console.log(urlSafe); // TG9ndG8Base64 is a representation, not a free lunch. Keep three things in mind:
No. It is reversible encoding with a public alphabet, so anyone can decode it instantly and it adds zero confidentiality. Encrypt sensitive data instead.
Base64 turns every 3 bytes into 4 characters, so the encoded form is always roughly one-third bigger than the original bytes.
They are padding that keeps the output a multiple of 4 characters. One "=" means the input had 2 leftover bytes; two "=" means it had 1; no "=" means the length was already a multiple of 3 bytes.
Base64URL is the same encoding with a URL- and filename-safe alphabet: - and _ replace + and /, and the = padding is usually dropped. It is common in URLs, filenames, and many web APIs.
Any binary: images, PDFs, keys, executables. Base64 works on raw bytes, so the original content type does not matter.
No. Encoding and decoding run entirely in your browser. Nothing you paste is uploaded or logged.