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 can go straight into HTML, JSON, or email; inside a URL, percent-encode its +, / and = characters first.
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 yourself in 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. This tool decodes URL-safe input but always encodes with the standard alphabet, as data URIs do.
- 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; accepted when decoding)
Related operations
To compute SHA hashes of text or files, or MD5 of text, 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 text built from 64 printable ASCII characters, so it can travel inside HTML, JSON, or email. The standard alphabet includes +, / and =, which need percent-encoding inside a URL.
- 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.
Last reviewed September 30, 2026
Other pages for this tool
Related tools
- Background reading: Complete guide to data tools