Base64 Encoder
Convert plain text or file content into Base64-encoded strings, entirely in your browser.
How to use Base64 Encoder
- 1Type or paste the text you want to encode.
- 2The Base64-encoded result appears instantly.
- 3Copy the result to your clipboard.
About Base64 Encoder
Base64 encoding converts binary or text data into an ASCII string, commonly used for embedding data in URLs, JSON, or email attachments. It works by taking three bytes of input at a time and re-expressing them as four printable characters drawn from a 64-character alphabet, which is why encoded output is always about 33% larger than the original. This tool encodes any text you enter directly in your browser.
Benefits
- • Quickly generate Base64 strings for embedding in code, configs or data URIs.
- • No upload required — encoding happens locally in your browser.
- • Safely move binary-ish content through text-only channels like JSON, XML, YAML or email bodies.
- • Produce data URIs for small images, fonts or SVGs you want to inline rather than request separately.
Common mistakes
- • Assuming Base64 is encryption — it's an encoding scheme, not a security measure, and is trivially reversible.
- • Expecting Base64 to compress data — it does the opposite, inflating the payload by roughly 33% before any transport compression.
- • Using standard Base64 output directly in a URL or filename, where + / and = characters need escaping — use base64url instead.
Frequently Asked Questions
No. Base64 is an encoding format, not encryption — anyone can decode it instantly. Never use it to protect sensitive data.
Base64 processes input in 3-byte groups that map to 4 output characters. When the final group has only one or two bytes left over, padding characters are appended so the output length stays a multiple of four: two = signs for one leftover byte, one = sign for two.
base64url is a URL-safe variant defined in RFC 4648 that replaces the + and / characters with - and _, and usually drops the = padding. It's what JWTs and many URL parameters use, because the standard characters would otherwise need percent-encoding.
About 33% larger, since every 3 bytes become 4 characters, plus up to 2 padding characters. That's the main reason inlining large images as data URIs is usually a worse trade than serving them as separate cacheable files.
Text is first converted to bytes using UTF-8, and those bytes are then Base64-encoded. This means a multi-byte character such as an emoji contributes several bytes to the input, so the encoded output is longer than the visible character count suggests.