Paste text or drop a file, get Base64 back — with the URL-safe alphabet, 76-column wrapping and data URI prefixes that APIs actually ask for.
The conversion happens in this tab. Careful with one thing though: Base64 is an encoding, not encryption. Anyone holding a Base64 string can read it in one step, so it is the wrong place to hide a password or a token.
Base64 exists for one reason: to move binary data through channels that only accept text. Email, JSON, XML, HTTP headers and data URLs all break if given raw bytes, so the bytes are mapped onto 64 printable characters first and mapped back at the other end.
+ and /. Turn on URL-safe and those become - and _, which is what you need for query strings, filenames and JWT payloads.=== want a single unbroken string.Base64 turns every three bytes into four characters, so the overhead is fixed at one third — but only once the input is long enough to amortise the padding. Short strings look much worse than the rule suggests:
| Input | UTF-8 bytes | Base64 characters | Ratio |
|---|---|---|---|
Hello, world! | 13 | 20 | 1.54× |
| A 100-character ASCII string | 100 | 136 | 1.36× |
中文 (two characters) | 6 | 8 | 1.33× |
| A 346 KB photo | 354,512 | 472,876 | 1.33× |
The photo is the number worth internalising. Encoding it produces 472,876 characters — a string larger than the image itself, which then has to be held in memory as text, copied into JSON, escaped again on the way out, and parsed at the other end. That is why binary upload exists. Use a data URI for an icon measured in kilobytes, not for a photograph measured in megabytes.
Note the Chinese case as well: two characters cost six bytes, not two, because UTF-8 spends three bytes on each. The Base64 is eight characters against what a naive byte-per-character assumption would call three. This is exactly where implementations that call btoa on a raw JavaScript string fall over — the string is not bytes, and the conversion has to happen first.
Padding is the detail that breaks integrations. The = characters exist only to round the output up to a multiple of four, and systems disagree about them: some require the padding, some reject it, and some strip it on the way in and expect you to restore it on the way out. If a decoder refuses a string that looks perfectly valid, counting the characters and checking whether the length is divisible by four takes about five seconds and solves it most of the time.
- and _ decoded with the standard alphabet produces garbage or an error. If a decoder rejects input that looks valid, this is the first thing to check.=. Some systems require the padding, others reject it. Neither behaviour is wrong; you just have to match the receiver.No, and this is the mistake that causes real leaks. Base64 is a reversible encoding with no key, so anyone can decode it in one step. Storing a password or an API token as Base64 offers exactly as much protection as storing it in plain text.
Three bytes become four characters, so the output is 4/3 of the input, about 33 percent larger. There is no way around this: the encoding exists to move binary data through text-only channels, not to compress it.
Standard Base64 uses plus and slash, which have special meanings inside a URL and a filename. The URL-safe alphabet replaces plus with minus and slash with underscore, so the result can be pasted into a query string without encoding. JWT tokens use this variant.
Older implementations call btoa directly on a JavaScript string, which only works for characters below U+0100. Anything above that is silently corrupted. This tool converts to UTF-8 bytes first, so accented letters, Chinese characters and emoji all survive a round trip.
This one is free with no counter — it runs in your browser and costs nothing to serve. All-Access is for the PDF and image tools, which are free three runs a day.