Base64 decode and encode
Decode Base64 to readable text or encode text as Base64, with full UTF-8 support and URL-safe mode. Files become data URIs in one step.
Files and data URIs
How Base64 works
Base64 takes bytes three at a time, lays their 24 bits side by side, and cuts them into four 6-bit pieces. Six bits can count from 0 to 63, and each number picks one character from the 64-character alphabet. Step through it:
Result: TWFu. Each Base64 character carries 6 bits, so 3 bytes (24 bits) become exactly 4 characters. When the last group has only 1 or 2 bytes, zeros fill the gap and “=” marks the missing characters.
Questions people ask
What is Base64?
Base64 represents binary data using 64 safe text characters (A–Z, a–z, 0–9, + and /). It is defined in RFC 4648 and used wherever binary must travel through text-only channels: email attachments (MIME), data: URIs, JSON payloads, JWTs and HTTP Basic auth.
Is Base64 encryption?
No. Anyone can decode it instantly, as this page shows. It is an encoding for transport, not a way to hide information.
Why is Base64 about 33% larger than the original?
Every 3 bytes become 4 characters, so the output is 4/3 the size, plus up to two “=” padding characters.
What is URL-safe Base64?
A variant (RFC 4648 §5) that swaps + for - and / for _ so the result can sit in URLs and filenames without percent-encoding. JWTs use it without padding. The decoder here accepts both forms automatically.
Why does my decoded output look like garbage?
The Base64 probably contains binary data such as an image, PDF or compressed file, not text. Use “Decode to file” to download the bytes, or check the first characters: iVBOR is a PNG, /9j/ a JPEG, JVBER a PDF.
Do my files get uploaded?
No. Files are read and encoded by your browser with the FileReader API.