About the Base64 Encode/Decode
This Base64 Encode/Decode tool converts plain text into Base64 and back. It handles UTF-8 correctly, so accented letters, non-Latin scripts, and emoji survive the round trip.
How it works
Encoding first converts your text to UTF-8 bytes. Every three bytes (24 bits) are split into four 6-bit groups, and each group is mapped to one of 64 characters: A to Z, a to z, 0 to 9, + and /. If the byte count is not a multiple of three, the output is padded with one or two = signs. The result is about 33 percent longer than the input.
Decoding accepts standard and URL-safe Base64 (with - and _), with or without = padding, and ignores whitespace and a data: URL prefix. The bytes are then checked: if they are valid UTF-8 they are shown as text; otherwise the tool recognizes common file types such as PNG, JPEG, GIF, WebP, PDF and ZIP from their first bytes, previews images and offers the file as a download.
How to use
- 1
Choose Encode or Decode.
- 2
To encode, type text or drop a file; to decode, paste the Base64.
- 3
Pick options such as URL-safe, line wrapping or data: URL.
- 4
Copy the result, download the decoded file, or click Swap to reverse it and check the round trip.
Worked examples
Simple text
Encoding a greeting.
Basic Auth credentials
Building an Authorization header value.
The header would be: Authorization: Basic dXNlcjpwYXNz
Accented text
Encoding a word with é.
é is two bytes in UTF-8, so the result reflects five bytes in total.
Frequently asked questions
Is Base64 encoding a form of encryption?+
No. It is an encoding, not encryption, and anyone can reverse it without a key.
Why does the output end with = signs?+
Base64 works in 3-byte blocks. When the input does not divide evenly, = padding fills out the last block.
Does it support emoji and non-English text?+
Yes. Text is converted to UTF-8 bytes before encoding and decoded as UTF-8.
Why is the Base64 version longer than my text?+
Every 3 bytes become 4 characters, so Base64 output is about 33 percent larger than the input.
Can I encode an image file here?+
Yes. Drop any file onto the encode box to get its Base64, or tick As data: URL to get a ready-to-use data URL.