How to use the Base64 Encoder & Decoder
- Choose Encode or Decode.
- Paste your text or Base64 string.
- Read the result and copy it.
How it works
Base64 (RFC 4648) represents binary data using 64 printable characters: A to Z, a to z, 0 to 9, plus + and /. Every 3 bytes of input become 4 characters, and = signs pad the end when the input length is not a multiple of 3.
Text is first converted to UTF-8 bytes, so characters outside basic English, such as é or 漢, encode correctly. Decoding reverses the process and reads the bytes back as UTF-8.
Output length = 4 × ceil(Input bytes ÷ 3)
"Hello" (5 bytes) → SGVsbG8=
"héllo" (6 bytes in UTF-8) → aMOpbGxvWorked example: encoding text with an accent
"Hello" is 5 bytes, which becomes 8 characters including one = of padding: SGVsbG8=.
"héllo" looks like 5 characters but is 6 bytes in UTF-8, because é takes two bytes. It encodes to aMOpbGxv with no padding, since 6 is a multiple of 3.
| Text | Base64 |
|---|---|
| Hello | SGVsbG8= |
| héllo | aMOpbGxv |
| Hi? | SGk/ |
Limitations
- Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
- Encoded data is about 33% larger than the original.
- Base64URL, used in JWTs and URLs, replaces + and / with - and _ and often drops padding. Convert those characters back before decoding here, or use the JWT decoder.
Where Base64 is used
Base64 appears wherever binary data must travel through a system built for text. Email attachments are encoded this way in MIME messages, small images can be embedded directly in HTML or CSS as data URIs, and HTTP Basic authentication sends the username and password as a Base64 string.
In each case the encoding only changes the representation. Because it is trivially reversible, credentials encoded this way are protected only by the secure connection they travel over, never by the encoding itself.
When decoding fails, check for stray whitespace, missing padding characters, or the URL-safe variant, which uses hyphens and underscores in place of plus and slash characters.
Frequently asked questions
What is Base64 used for?
Sending binary data through systems designed for text: email attachments (MIME), data URLs that embed images in HTML or CSS, and basic authentication headers.
Is Base64 secure?
No. It provides no secrecy at all and is reversed instantly. Use real encryption for sensitive data.
Why does my decoded text look garbled?
The original data may not be text, for example an image or a compressed file, or it may have been encoded from a different character set than UTF-8.
What do the = signs at the end mean?
Padding. Base64 works in groups of 3 bytes; = fills the final group when the input length is not a multiple of 3.