Base64 Encode Text
Type or paste any text and get the Base64 representation instantly. Everything runs in your browser.
BASE64
Converts UTF-8 text to Base64 encoding. Handles Unicode characters correctly.
How it works
Your text is first run through TextEncoder, which converts the characters to a UTF-8 byte sequence so emoji and non-Latin scripts encode correctly. Those bytes are then passed to the browser's built-in btoa() function, which groups them into 6-bit chunks and maps each to the standard Base64 alphabet, padding with '=' as needed. The output is suitable for embedding in HTML, JSON, URLs, or email headers.
Processing runs in your browser
All encoding and decoding happens inside your browser tab. Our servers are not involved at any point. You can confirm this yourselfin your browser's DevTools Network tab.
Technical specification
Base64 is specified in RFC 4648 (IETF, 2006). The encoding groups every three input bytes (24 bits) into four 6-bit values, each mapped to a printable ASCII character from a 64-character alphabet (A–Z a–z 0–9 + /). If the input length is not divisible by 3, one or two = padding characters are appended. The URL-safe variant (RFC 4648 §5) replaces + with - and / with _, making it safe for use in URLs and HTTP headers without further percent-encoding.
- Standard
- RFC 4648. The Base16, Base32, and Base64 Data Encodings
- Size overhead
- ~33% overhead (every 3 bytes becomes 4 characters)
- Alphabet (standard)
A–Z a–z 0–9 + /with=padding- Alphabet (URL-safe)
A–Z a–z 0–9 - _(used in JWTs, data URIs)
Related operations
To compute MD5 or SHA hashes from text or files, use the hash generator. For percent-encoding query strings or URL paths, try URL encode. To decode signed tokens that wrap Base64 payloads, see the JWT decoder.
Frequently asked questions
- What is Base64 encoding?
- Base64 converts binary or text data into a string of ASCII characters, making it safe to embed in HTML, JSON, URLs, or email.
- Does this handle Unicode and emoji?
- Yes. The tool uses UTF-8 encoding before Base64, so all Unicode characters are handled correctly.
- Is my text sent to a server?
- All processing runs in your browser using btoa().
- Why does the Base64 output end with one or two = signs?
- Base64 encodes data in groups of three bytes. When the input length is not a multiple of three, padding characters (=) are appended so the output length is always a multiple of four. This padding is part of the standard.