Base64 Encoder
Turn text or a file into Base64. Emoji, accented letters and Japanese are encoded as proper UTF-8, and the URL-safe option gives you a string that is legal in a URL or a JWT.
Correct UTF-8, not Latin-1
The browser's built-in `btoa` throws on anything outside Latin-1, which is why so many quick scripts mangle non-English text. This tool encodes the string to UTF-8 bytes first, so "café", "日本語" and emoji round-trip exactly. Decoding the result anywhere that expects UTF-8 gives back the original.
URL-safe output for tokens and query strings
Standard Base64 uses `+` and `/`, both of which have meaning inside a URL, and `=` padding that often has to be escaped. The URL-safe option swaps them for `-` and `_` and drops the padding, which is the alphabet used by JWTs, OAuth state parameters and many APIs.
Files, including images for data URIs
Choose a file to encode its raw bytes. The result is what you paste after `data:image/png;base64,` to inline an image in CSS or HTML, or what an API expects when it takes a document as a Base64 string. Large files are processed locally, so there is no upload wait.
Frequently asked questions
Is my file or text uploaded?
No. Nothing you paste leaves your browser. The page loads a small amount of JavaScript, and every calculation happens on your own machine - there is no server to send data to. People routinely Base64-encode certificates and credentials, so the whole tool is built to work offline once loaded.
Is Base64 encryption?
No, and this is worth being blunt about: Base64 is an encoding, not encryption. Anyone can decode it instantly with no key. Use it to move binary data through a text channel - never to hide a password or a token.
When do I need line wrapping?
Email (MIME) and PEM certificates require a line break every 76 and 64 characters respectively. Most APIs and data URIs want one unbroken line. Leave wrapping off unless the format you are targeting asks for it.
Why is the output about a third larger than the input?
Base64 represents three bytes with four ASCII characters, so the encoded form is roughly 133% of the original size, plus padding. That overhead is the price of moving binary data safely through text-only channels.