Encode text to Base64 or decode it back — UTF-8 safe, with a URL-safe variant — using the full 64-character alphabet and padding rules printed on the page. Runs entirely in your browser — your numbers never leave this device.
Mode
Alphabet
Text to encode
…or encode a file
Result
How it works
Group the bytes into 3s: each 3 bytes (24 bits) → 4 characters of 6 bits each, taken from the 64-character alphabet | 1 leftover byte → 2 characters + == | 2 leftover bytes → 3 characters + = | Encoded length = 4 × ceil(bytes ÷ 3)
The Base64 alphabet and the padding rule
Characters / input case
Index / output
Notes
A–Z
0–25
Uppercase letters open the alphabet
a–z
26–51
Lowercase letters follow
0–9
52–61
Digits come next
+
62
Standard alphabet — written - in the URL-safe variant
/
63
Standard alphabet — written _ in the URL-safe variant
= (padding)
No value
Pads the output to a multiple of 4 characters
1 leftover byte
2 characters + ==
The last group carries 8 real bits in 2 characters
2 leftover bytes
3 characters + =
The last group carries 16 real bits in 3 characters
0 leftover bytes
4 characters, no padding
The byte count was an exact multiple of 3
Base64 exists to carry binary data through channels that only handle safe text — email, URLs, JSON strings, data URIs. The method is a regrouping, nothing more: take the bytes three at a time, split each 24-bit group into four 6-bit numbers, and write each number as a character from the 64-character alphabet in the table below. Text is first encoded as UTF-8 bytes, so accented letters and emoji survive the round trip — the café example below is nine UTF-8 bytes, not seven characters, and the output length follows the bytes.
Two conventions decide whether a decoder accepts your string. First, padding: when the byte count is not a multiple of three, equals signs pad the output to a multiple of four characters, and the count of equals signs tells the decoder how many bytes the last group really held. Second, the variant: the standard alphabet ends in + and /, which are dangerous inside URLs, so the URL-safe variant swaps them for - and _ and usually drops the padding. This tool offers both, and decoding rejects characters outside the chosen alphabet instead of guessing.
One honest warning, because it is the most common misunderstanding of this tool: Base64 is an encoding, not encryption. Anyone who sees a Base64 string can decode it instantly — it hides nothing, it only makes bytes transportable. And like every Kwikfig tool, the conversion runs in your browser; the text you encode never leaves your device.
Worked examples
Encoding a word with a padded ending
Input
Text = Kwikfig
Working
Kwikfig is 7 bytes: two full groups of 3, plus 1 leftover byte. The leftover byte becomes 2 characters plus == padding, and the total length is 4 × ceil(7 ÷ 3) = 12 characters.
Result
S3dpa2ZpZw==
Non-ASCII text: café ☕
Input
Text = café ☕
Working
Counted as UTF-8 bytes, not characters: c, a, f are 1 byte each, é is 2 bytes, the space is 1, and ☕ is 3 — 9 bytes in total, exactly three full groups, so there is no padding.
Result
Y2Fmw6kg4piV
Decoding back to text
Input
Base64 = aGVsbG8=
Working
Eight characters make two groups of four. The single = on the second group says it carried only 2 real bytes, so the output is 3 + 2 = 5 bytes — the word hello.
Result
hello
Frequently asked questions
Why is Base64 output about a third longer than the input?
Because each output character carries only 6 bits while each input byte holds 8. Four characters carry three bytes, so the encoded size is 4 × ceil(bytes ÷ 3) — a 7-byte word like Kwikfig comes out at 12 characters, and a 300 KB file at roughly 400 KB of text. That overhead is the price of using only safe, printable characters.
What is URL-safe Base64, and when do I need it?
It is the same encoding with the two URL-hostile alphabet characters swapped (+ becomes -, / becomes _) and the = padding usually dropped. Use it when the encoded value travels inside a URL, a filename or a token. Use the standard alphabet everywhere else, because some strict decoders expect the padding to be present.
Is Base64 a way to hide or protect data?
No. Base64 is a public, reversible encoding with no key — anyone can decode any Base64 string in a second, including with this very page. It is suitable for transporting data, never for protecting it. Passwords, tokens and private text need real encryption or hashing, not an encoding.
Why does decoding fail on my string?
Usually one of three reasons: the string contains characters outside the Base64 alphabet (a standard string pasted into a URL-safe decoder, or the other way round), whitespace or line breaks were copied inconsistently, or the string was truncated so its length and padding no longer agree. This tool names the problem instead of returning corrupted bytes.
Does it handle accents and emoji correctly?
Yes, because text is converted to UTF-8 bytes before encoding and decoded back as UTF-8 afterwards. That is why café ☕ encodes to Y2Fmw6kg4piV and returns exactly. Tools that treat text as single-byte Latin characters corrupt anything beyond plain ASCII — the byte count is the tell: 7 characters became 9 bytes.
Is what I encode uploaded anywhere?
No. Encoding and decoding run entirely in your browser — the text never leaves your device and is not stored or tracked.