Base64 Encoder & Decoder Online
Encode text to Base64 or decode Base64 back to readable text instantly. Full UTF-8 support for accents, emoji and every script, plus URL-safe Base64URL. Free, private and browser-based.
Your text never leaves your browser.
Encoded Base64
Paste text to encode it as Base64, or switch to Decode Base64 and paste an encoded value.
Base64 options
How to encode and decode Base64 online
Pick a direction in the options panel. Encode to Base64 turns any text into a Base64 string; Decode Base64 turns a Base64 string back into readable text. Choose Standard Base64 or URL-safe Base64URL to match the value you are working with, then paste your input. The result updates as you type. Copy it, or send it back into the input with Use as input to decode or encode another layer yourself.
What Base64 encoding is and how it works
Base64 represents arbitrary bytes using only 64 printable ASCII characters, so binary data can travel through systems built for text, such as email, JSON, data URLs and HTTP headers. Every group of 3 bytes (24 bits) is split into four 6-bit values, and each value picks one character from the alphabet. That is why Base64 output is about a third longer than the input. When the last group has only one or two bytes, = padding fills the group to four characters.
| Text | Standard Base64 | Base64URL |
|---|---|---|
| Hello, world! | SGVsbG8sIHdvcmxkIQ== | SGVsbG8sIHdvcmxkIQ |
| Café | Q2Fmw6k= | Q2Fmw6k |
| 😀 | 8J+YgA== | 8J-YgA |
| A | QQ== |
Standard Base64 vs Base64URL
Standard Base64 (RFC 4648) uses + and /, which have special meaning in URLs and file paths. Base64URL swaps them for - and _ and normally drops the trailing =, so the value can go in a query string, a file name or a JWT segment without escaping. The two alphabets are not interchangeable: this tool decodes strictly with the alphabet you select and tells you when a character belongs to the other one, rather than guessing. Values containing only letters and digits can be valid in both alphabets.
8J+YgA==
8J-YgA
UTF-8, Unicode and emoji support
Base64 encodes bytes, not characters, so text first has to become bytes. This tool always uses UTF-8: é becomes the two bytes C3 A9 and 😀 becomes four bytes, F0 9F 98 80. Lithuanian, Cyrillic, Chinese, combining accents and emoji sequences all round-trip exactly, with no normalization. When decoding, a leading byte-order mark is kept as U+FEFF instead of being silently dropped. To see exactly which code points and UTF-8 bytes a string contains, open it in the Unicode Inspector.
Character counts use Unicode code points: combining marks and joined emoji can each contain multiple code points. UTF-8 byte counts measure the actual encoded or decoded bytes. Each conversion is limited to 2 MiB (2,097,152 bytes) of UTF-8 input or decoded data. Decoding returns one layer of text; it does not parse JSON or JWTs.
Why Base64 decoding sometimes fails
Decoding is strict so that corrupted values are caught rather than turned into garbage. Common causes are characters outside the selected alphabet (for example - in standard mode or % from URL encoding), padding in the middle or the wrong amount of it (Zg=), a length that leaves a single character over, or a final character with stray bits (Zh==), which usually means the value was truncated or edited. Hidden characters such as non-breaking or zero-width spaces are reported, never removed; the Text Cleaner can strip them. If the Base64 is valid but the bytes are not UTF-8, it probably holds binary data such as an image or compressed file rather than text.
Is Base64 encoding secure?
No. Base64 is an encoding, not encryption: there is no key, and anyone can reverse it in a second. It is useful for transporting data safely through text-only channels, not for hiding it. Never rely on Base64 to protect passwords, API tokens or personal information. JWT payloads, for example, are Base64URL-encoded and readable by anyone who has the token.
Related CleanGlyph tools
Read JWT headers and claims with the JWT Decoder & Claims Inspector, calculate SHA-256 checksums of text or files with the SHA-256 Hash Generator, escape text for HTML source with the HTML Entity Encoder & Decoder, inspect hidden code points with the Unicode Inspector, tidy copied text with the Text Cleaner, or confirm that a decoded value matches the original with the Text Difference Checker.
Frequently asked questions
How do I decode Base64 to text?
Choose Decode Base64, pick the alphabet your value uses (standard or URL-safe), and paste it. The decoded UTF-8 text appears instantly. If the value contains - or _ it is Base64URL; if it contains + or / it is standard Base64. Values using only the shared letters and digits can be valid in both alphabets.
How do I encode text as Base64?
Keep the default Encode to Base64 direction and paste or type your text. It is converted to UTF-8 bytes and then to Base64 as you type, ready to copy.
What is the difference between Base64 and Base64URL?
Both use the same 64-character idea, but standard Base64 uses + and / and pads with =, while Base64URL replaces them with - and _ and usually omits padding. Base64URL values can be placed in URLs, file names and JWT segments without escaping.
Can Base64 encode Unicode and emoji?
Yes. Base64 encodes bytes, so text is first converted to UTF-8. Accented letters, Cyrillic, Chinese and emoji all round-trip exactly. For example, 😀 is the four UTF-8 bytes F0 9F 98 80, which encode as 8J+YgA==.
Why does Base64 sometimes end with =?
Base64 turns every 3 bytes into 4 characters. When the input length is not a multiple of 3, one or two = characters pad the final group to four characters. They carry no data.
Can I decode Base64 without padding?
Yes. Both padded and unpadded input are accepted in either alphabet, so SGVsbG8= and SGVsbG8 both decode to Hello. Padding in the wrong place or the wrong amount, such as Zg=, is rejected.
Why do I get an invalid UTF-8 error?
The Base64 itself was valid, but the bytes it contains are not readable UTF-8 text. It most likely encodes binary data such as an image, a compressed file or a key, or text saved in another encoding. The tool reports this instead of showing garbled replacement characters.
Is Base64 encrypted or secure?
No. Base64 is an encoding, not encryption. Anyone can decode it without a key, so it does not hide passwords, tokens or personal data. Use real encryption when you need confidentiality.
Is my text uploaded or stored?
No. Encoding and decoding run entirely in your browser. Your input and output are never sent to a server, saved or logged, and decoded links or HTML are shown as plain text only.