Base64 Encoder
Encode any text into Base64 using the browser-native btoa() function, with full Unicode/UTF-8 support.
- 1Paste your text
- 2Make sure the Encode tab is selected
- 3Click Process
- 4Copy the Base64 output
What Base64 encoding is
Base64 turns arbitrary data into a string made only of letters, digits, +, / and = padding. That makes it safe to carry through systems that only handle plain text, such as email bodies, JSON fields, URLs or HTML attributes. This tool encodes the text you type as UTF-8 first and then as Base64, so accented letters, non-Latin scripts and emoji encode correctly instead of failing.
Example
The text Hello encodes to SGVsbG8=. The text café encodes to Y2Fmw6k=, because the é is two bytes in UTF-8.
Common uses
- HTTP Basic authentication. The header value is the Base64 form of
username:password. - Data URIs. Small images or fonts embedded in HTML or CSS use Base64 after
data:image/png;base64,. - Email attachments. MIME encodes binary files as Base64 text.
- Configuration and secrets in Kubernetes. Secret values are stored Base64-encoded.
- Embedding binary data in JSON, which has no native binary type.
Important facts
- Base64 is not encryption. Anyone can decode it instantly. Never use it to hide passwords or private data.
- It makes data larger. Every 3 bytes become 4 characters, an increase of about 33%.
- Padding. The trailing
=signs fill the last group of bytes. Some systems strip them; many decoders accept either form. - Standard versus URL-safe. This tool uses the standard alphabet with
+and/. URL-safe Base64 replaces them with-and_, which is what JSON Web Tokens use. Swap those characters if you need the URL-safe variant. - Text input only. This version encodes typed or pasted text. For files and images, the image tools on this site handle conversion directly.
Decoding
To reverse the process, paste the encoded text into the Base64 decoder. If you work with tokens, the JWT decoder reads the Base64URL sections of a token for you. For safe query strings, see the URL encoder.