How to use
- Choose Encode and type some text — the Base64 appears instantly. Text is converted to UTF-8 bytes first, so accented letters, CJK and emoji survive the round trip.
- Choose Decode and paste a Base64 string to get the original text back. Line breaks, missing
=padding and URL-safe characters (-_) are handled automatically. - Turn on URL-safe when the value goes into a URL or file name:
-and_replace+and/, and trailing=is dropped. - In the File → Base64 section, convert an image or any other file (up to 10 MB) to Base64 or a
data:URI.
How Base64 works
Base64 (RFC 4648) splits every 3 bytes (24 bits) into four 6-bit groups and maps each to one of 64 characters. Output is therefore about 33% larger than the input, and = pads the end when the length isn’t a multiple of 3.
| Variant | Alphabet | Padding | Used in |
|---|---|---|---|
| Standard Base64 | A–Z a–z 0–9 + / | = |
Email attachments (MIME), data URIs, HTTP Basic auth |
| URL-safe (base64url) | A–Z a–z 0–9 - _ | usually omitted | JWTs, URL parameters, file names |
Examples
| Input | UTF-8 bytes | Base64 |
|---|---|---|
Hi |
2 | SGk= |
é |
2 (C3 A9) | w6k= |
Hello 👋 |
10 | SGVsbG8g8J+Riw== |
An emoji takes 4 bytes in UTF-8, so it adds more to the Base64 output than a plain letter does.
Things to know
- Base64 is not encryption. Anyone can decode it instantly, so never use it to hide passwords or keys. To check integrity, use the Hash Generator.
- If decoded bytes aren’t valid UTF-8 (an image or PDF, say), you’ll see the first bytes in hex and can save them as a binary file.
- Inlining large images as data URIs in HTML or CSS defeats caching and bloats the page. It’s best kept for icons of a few KB.
FAQ
Why do other tools garble non-English text?
The browser’s built-in btoa/atob only handle single-byte (Latin-1) characters, so text outside that range throws an error or comes out garbled. This tool uses TextEncoder/TextDecoder for exact UTF-8 conversion.
Is my text or file uploaded?
No. Everything is converted inside your browser and nothing is sent over the network, so it’s safe for auth tokens and internal files.
How do I read what’s inside a JWT?
Each JWT segment is base64url-encoded JSON. The JWT Decoder splits out the header and payload and shows the expiry time.