Base64 Encoder Decoder
Encode text or a file to Base64, or decode Base64 back to readable text — with full support for emoji, Urdu and every other language. Everything runs locally in your browser.
Encode a File to Base64
What Base64 Is — and What It Is Not
Base64 is a way of writing any data — text, images, files — using only 64 safe characters: the letters A–Z and a–z, the digits 0–9, and the two symbols + and /, with = used as padding at the end. Computers store everything as bytes, and bytes can hold any value from 0 to 255, including control characters that break emails, URLs and text fields. Base64 repackages those bytes into a plain, printable alphabet that survives being pasted into a form, embedded in a web page or carried through systems that were designed for text only. If you have ever seen a long block of characters ending in one or two equals signs, you have almost certainly been looking at Base64.
One point deserves to be said plainly, because it is the most common and most dangerous misunderstanding: Base64 is not encryption. It hides nothing. Encoding is a public, keyless, reversible translation — anyone who receives a Base64 string can decode it in seconds with a tool exactly like this one, no password needed. A Base64-encoded password is exactly as secret as the plain password written on the same page. Real protection requires encryption (which scrambles data with a key) or hashing (for stored passwords); Base64's job is transport and compatibility, never secrecy.
Where Base64 Is Used
The most visible use is the data URL: a small image or icon written directly into a web page or stylesheet as data:image/png;base64,… followed by its Base64 form, saving a separate file request. The file mode above produces exactly this — the output is the part after the comma. Email depends on Base64 too: the protocol was built for plain text, so attachments and non-English text are Base64-encoded for the journey and decoded by your mail app. APIs and web services use it constantly to carry binary data inside JSON, which can only hold text, and to package files in requests. You will also meet it in authentication headers, embedded fonts, and configuration files that need to store a small binary blob as text.
The Cost: About 33% Bigger
Base64 is not free. Every 3 bytes of original data become 4 Base64 characters, so the encoded version is always about 33% larger than the source. A 1 MB image becomes roughly 1.37 MB of text; a 10 MB file becomes about 13.7 MB. That overhead is why data URLs suit small icons and logos but are a poor idea for large photos, why email attachments "grow" in transit, and why this page warns you when you choose a file bigger than 1.5 MB: the resulting string will be very long, may make your browser sluggish while you copy it, and can overflow message limits or text fields that were never designed for megabytes of pasted data. Encode big files only when you genuinely need to.
A Close Cousin: URL-Safe Base64
Standard Base64 has one awkward flaw: two of its 64 characters, + and /, are troublemakers inside web addresses, where a slash means a new path segment and a plus is read as a space. For that reason you will also meet a variant called Base64URL, which swaps + for - and / for _ and often drops the = padding entirely. It appears constantly in the wild — in the tokens websites use to keep you signed in, in share links, and in encoded data packed into URLs. If a string you are decoding contains dashes or underscores, that is the variant you are looking at; most tools, this one included, expect the standard alphabet for text decoding, so convert those two characters back first if a decode ever fails on an otherwise healthy-looking string.
Worked Example
Type the word Hello into the box above and press Encode: you get SGVsbG8=. The single equals sign is padding, added because the input length did not divide neatly into groups of three bytes. Now try text with characters outside plain English — an emoji, or Urdu text such as "سلام". A naive encoder breaks on such characters, but this tool first converts your text to its UTF-8 bytes and encodes those, so any language round-trips perfectly: paste the Base64 back in, press Decode, and your original text returns exactly. That same decode step is the quickest way to inspect a mysterious string you find in a log file, a URL or an email's raw source — paste it in and see what it actually says.
Frequently Asked Questions
Is Base64 a way to encrypt or hide data?
No. Base64 is an encoding, not encryption. Anyone can decode a Base64 string instantly without a key or password, so never treat encoded text as protected — an encoded password is still effectively a plain password.
Why does encoded text end with = signs?
The equals signs are padding. Base64 processes data in groups of three bytes; when the last group is short, one or two = characters are added so the length comes out even and decoders know exactly where the data ends.
Why did decoding fail with an error?
The input was not valid Base64 — it may contain characters outside the Base64 alphabet, be missing its padding, or have been cut off when copied. Check that you copied the complete string, with no spaces or line breaks added in the middle.
Is my text or file uploaded anywhere?
No. Encoding and decoding happen entirely in your browser, and files are read locally on your device. Nothing you paste or choose here is sent to or stored on a server.