Base64 Encode & Decode
Encode text or files to Base64 and decode Base64 back to text — UTF-8 safe, with URL-safe output option.
How to use the Base64 Encode & Decode
- Choose the Encode or Decode tab.
- Paste your text (or drop a file) into the input.
- The converted result appears instantly below.
- Toggle "URL-safe" if you need the output for a query string, then Copy.
Examples
| Input | Output | Notes |
|---|---|---|
Hello, World! | SGVsbG8sIFdvcmxkIQ== | Encode |
SGVsbG8sIFdvcmxkIQ== | Hello, World! | Decode |
café | Y2Fmw6k= | UTF-8 multi-byte characters handled correctly |
How Base64 works
Base64 takes 3 bytes (24 bits) of input and splits them into four 6-bit numbers, each mapped to one character of the 64-character alphabet. The output is always about 33% larger than the input. Decoding reverses the process.
Common uses
- Data URLs:
data:image/png;base64,iVBOR... - Embedding attachments in JSON APIs
- HTTP Basic Auth headers
- Storing binary blobs in text-only databases or cookies
Standard vs URL-safe
| Standard | URL-safe | |
|---|---|---|
| Char 62 | + | - |
| Char 63 | / | _ |
| Padding | = | often omitted |
Frequently asked questions
What is Base64 encoding?
Base64 represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, + and /). It lets you embed images, files or non-ASCII text in contexts that only accept text, such as JSON, XML, data URLs and email.
Does Base64 encrypt data?
No. Base64 is encoding, not encryption. Anyone can decode it. Never use it to protect passwords or secrets.
Why does my encoded string end with = signs?
The = is padding. Base64 works in 3-byte groups; when the input length is not a multiple of 3, one or two = characters pad the final group.
What is URL-safe Base64?
A variant that replaces + with - and / with _ so the string can be used in URLs and filenames without percent-encoding. Padding is often omitted too.
Can I Base64-encode an image?
Yes. Drop an image file into the input and the tool returns a Base64 string (and a ready-to-use data URL) that you can paste into CSS or HTML.