How to use this Base64 encoder
Paste or type your text into the first box, make sure the mode is set to Encode, and press “Encode to Base64”. The converted text appears in the result box instantly, ready to copy into an email header, a configuration file, a data URL or wherever Base64 is expected. To go the other way, switch the mode to Decode, paste the Base64 in, and press the button — you get the original text back, accents, emoji and all. The “Swap direction” button moves the result into the input and flips the mode, which makes round-trip checking a two-click job.
Two details set this tool apart from the browser's raw built-in functions. First, it is fully UTF-8 safe: text in any script — Urdu, Arabic, Chinese, accented European languages, emoji — encodes correctly instead of throwing the “characters outside of the Latin1 range” error that naive converters produce. Second, decoding is strict but helpful. Whitespace and line breaks copied from an email are ignored, but genuinely broken input produces a plain-English explanation of what to check rather than a silent blank box or a page full of gibberish.
The file option below the text boxes converts a small file — an icon, a logo, a signature image — into a complete data URL. The file is read by your browser only and never sent to a server, and the tool reports the file size, its type and the length of the Base64 it produced, so you can judge whether embedding it in a page is sensible before you paste it anywhere.
Example: text in, Base64 out
The everyday greeting:
encodes to:
Notice the two “=” signs at the end — that is padding, added so the length of the output is always a multiple of four characters. And here is the UTF-8 difference in action: “café ☕” encodes to “Y2Fmw6kg4piV”, a string that decodes back to exactly the same accented text and coffee cup, because the encoder worked on the text's UTF-8 bytes rather than its raw characters.
What Base64 is — and what it is not
Base64 exists because many systems were built to carry plain text and nothing else. Email protocols, early web forms and plenty of configuration formats will mangle or reject raw binary data, control characters and even some punctuation. Base64 solves that transport problem by re-writing any data using only 64 safe characters: the letters A–Z and a–z, the digits 0–9, and the two symbols + and /. Anything — a photo, a PDF, a line of Arabic poetry — can be carried through a text-only channel once it has been rewritten in that alphabet, and restored byte-for-byte at the other end.
The cost of that safety is size: every 3 bytes of input become 4 characters of output, so encoded data is roughly a third bigger. That trade is worth it for small payloads — a token in a header, a tiny embedded image, a key in a config file — and a poor one for large files, which is why this tool caps file conversion at 2 MB. The other thing Base64 is not is secrecy. Encoding is a public, reversible alphabet swap with no key involved; treat Base64 text as exactly as readable as the original, because to anyone with a decoder, it is.
Where you will meet Base64 in the wild
Developers bump into Base64 constantly: in the JWT tokens that carry login sessions (each token segment is Base64URL, a close cousin), in HTTP Basic authentication headers, in email attachments encoded as MIME, and in data URLs that embed small images directly in HTML and CSS. If a tool, API or tutorial is asking you to “provide the Base64 of” something, it is asking for this exact transformation — and text you encode here will decode identically in Python, PHP, Java, the command line and every other standards-following tool.
Frequently asked questions
Is my text uploaded to a server?
No. The encoding and decoding run in JavaScript inside your own browser. Nothing you paste or convert is sent anywhere, stored anywhere or logged — you can disconnect from the internet after the page loads and the tool keeps working.
Why does encoded text get longer?
Base64 stores every 3 bytes of data in 4 characters drawn from a safe 64-character alphabet, so the output is always about a third longer than the input, plus up to two “=” padding characters at the end to round it out.
What does “UTF-8 safe” mean?
The browser's built-in Base64 function only accepts Latin-1 characters and throws an error on text like “café ☕” or Arabic and Chinese scripts. This tool first converts your text to its UTF-8 bytes and encodes those, so any language, accent or emoji encodes and decodes correctly.
Is Base64 a form of encryption?
No. Base64 is an encoding, not encryption — anyone who receives the text can decode it instantly with no key or password. Never rely on Base64 to protect passwords, tokens or private data; it only makes data safe to transport, not safe from readers.
Why does my Base64 fail to decode?
The usual causes are a missing character from copying, the “=” padding being cut off, or a data URL prefix such as “data:image/png;base64,” still attached — remove everything before the comma. This tool also rejects the URL-safe variant that swaps + and / for - and _.
What is a Base64 data URL?
A data URL embeds a file directly inside text: it starts with the file type, then “;base64,” and then the Base64 of the file. Browsers accept data URLs in image tags and CSS, which is handy for tiny icons and logos because no separate file request is needed.
How large a file can I convert to Base64?
The file converter accepts files up to 2 MB, which covers icons, logos, signatures and small images. Remember the Base64 output is about a third larger than the file, so embedding big photos in HTML quickly makes pages heavy.
Can I decode Base64 that came from a binary file?
The tool decodes it to bytes first. If those bytes form readable UTF-8 text you will see the text; if the Base64 came from an image, zip or PDF, the tool tells you it is binary data instead of printing gibberish.
Does Base64 give the same result everywhere?
Yes. Base64 is a fixed standard (RFC 4648), so text encoded here decodes identically in Python, PHP, JavaScript, command-line tools and every other converter that follows the standard alphabet and padding.