Base64 Encoder - Encode Text and Files to Base64 Online
Encode text, JSON or any file to Base64 in your browser. Text is turned into UTF-8 first, so accents and emoji come out right, and uploaded files are encoded byte for byte.
Base64 encoder, Base64 encode, encode to Base64, Base64 encoding online, text to Base64, Base64 converter, encode Base64 online, Base64 tool
How to Encode Text to Base64 - Step by Step Guide
Input Your Text or Data
Ready to encode your data? Simply paste your text, JSON, or any other content into the input area, or upload a file. The encoder handles UTF-8 characters, special symbols, and binary files, which are encoded from their raw bytes.
Example: Try This Sample Text
Copy and paste this example to see how it works:
Hello World! This is a Base64 encoding example. Special characters: @#$%^&*()+=[]|;:'",./<>? Unicode: café résumé naïve 😀 Numbers and symbols: 12345 !@#$% αβγδε
See Automatic Base64 Encoding
The Base64 shows up on the right as you type, in RFC 4648 compliant Base64 format. Your text is turned into UTF-8 bytes first, so the accented letters and the emoji below encode the same way they would in Python or on the command line.
Base64 Encoded Output
Your text becomes this Base64 encoded format:
SGVsbG8gV29ybGQhIFRoaXMgaXMgYSBCYXNlNjQgZW5jb2RpbmcgZXhhbXBsZS4KU3BlY2lhbCBjaGFyYWN0ZXJzOiBAIyQlXiYqKCkrPVtde318OzonIiwuLzw+PwpVbmljb2RlOiBjYWbDqSByw6lzdW3DqSBuYcOvdmUg8J+YgApOdW1iZXJzIGFuZCBzeW1ib2xzOiAxMjM0NSAhQCMkJSDOsc6yzrPOtM61
Copy or Download Your Encoded Data
Perfect! Now you can copy the Base64 encoded data to your clipboard or download it as a file. The output is ready to use in web applications, APIs, and data storage.
What is Base64 Encoding?
Base64 encoding is a binary-to-text encoding scheme that converts binary data into ASCII text format using a set of 64 characters (A-Z, a-z, 0-9, +, /). This encoding ensures that data can be safely transmitted over systems that only handle text, such as email and HTTP.
The encoding process takes every 3 bytes of input data and converts them into 4 Base64 characters following RFC 4648 standards. This makes the encoded data about 33% larger than the original, but ensures compatibility across different systems and protocols, particularly in MIME email systems.
How Base64 Encoding Works
Base64 encoding works by splitting binary data into groups of 6 bits and mapping each group to one of 64 printable characters. The encoding algorithm converts every three bytes (24 bits) of input into four Base64 characters.
When the input length isn't a multiple of 3, padding characters (=) are added to make the output length a multiple of 4. This ensures proper decoding. In the browser, the last step is usually the btoa() function, but btoa() only understands Latin-1 characters. It throws on emoji and quietly writes é as a single byte, so this page converts your text to UTF-8 bytes with TextEncoder before encoding.
Frequently Asked Questions
What is Base64 encoding used for?
Base64 encoding converts binary data or text into ASCII characters for safe transmission over text-based protocols like email, HTTP, or JSON according to RFC 4648 standards. It's commonly used for embedding images, files, or data in web applications. For decoding, use our Base64 Decoder.
Can I encode files with this tool?
Yes. Click Upload and pick any file: an image, a PDF, a ZIP. The page reads the file's raw bytes and encodes them exactly, so decoding the result gives you back the same file. Text files also appear in the editor; other files aren't shown there, but their Base64 still appears on the right.
Is Base64 encoding secure?
Base64 is encoding, not encryption. It makes data unreadable to casual observers but provides no security. Anyone can easily decode Base64 data using tools or the browser's atob() function, so don't use it to protect passwords or other sensitive information.
Why does Base64 make data larger?
Base64 encoding increases data size by approximately 33% because it uses 4 ASCII characters to represent every 3 bytes of original data. This overhead is the trade-off for text compatibility and safe transmission through systems like MIME email that only support ASCII text.
Can I use Base64 encoding in programming?
Yes. Most languages have it built in: Python has base64.b64encode(), Java has Base64.getEncoder(), and JavaScript has btoa(). One catch with btoa(): it only accepts Latin-1 characters, so for text with emoji or other scripts you have to turn it into UTF-8 bytes with TextEncoder first. That's what this page does, which is why José 😀 comes out as Sm9zw6kg8J+YgA==.
Is this Base64 encoder free, and is my data uploaded?
It's free and there's nothing to sign up for. Encoding runs in your browser, so your text and files stay on your machine unless you click Share, which saves your input on our server to make a link. Very large files can be slow, since the whole result has to fit in the editor, and the output is about a third bigger than the input.
Related Tools
Base64 Decoder
Decode Base64 encoded data back to text
Base64 Validator
Validate Base64 encoded strings with detailed format checking and content type detection
Base64 URL Encoder
Encode text to URL-safe Base64 format for JWT tokens, OAuth, and web APIs
Base64 URL Decoder
Decode URL-safe Base64 strings from JWT tokens, OAuth responses, and API data
Image to Base64
Convert images to Base64 encoded strings for embedding in HTML, CSS, and APIs
Base64 to Image
Decode Base64 encoded strings to view and download images (PNG, JPG, GIF, SVG)