Base64 encode and decode
Turns text or a file into Base64 and turns Base64 back into readable text. Your file is never uploaded; the work happens on your device.
Base64 is an encoding, not encryption — anyone can decode it. Don't use it to protect secrets. Everything runs in your browser: neither your text nor the file you pick is sent to a server.
How to use
- Choose Encode or Decode with the buttons above.
- Paste your text into the box, or press Choose a file to encode a file.
- Tick URL-safe if the result goes in a URL, or wrap at 76 for email and MIME.
- Take the result with Copy, or save it with Download.
What Base64 is
Base64 is an encoding that turns binary data into text made of 64 safe characters: A-Z, a-z, 0-9, + and /, with = at the end as padding.
It exists for a simple reason: much of the internet was built to carry text. Push raw binary through email, JSON, XML or HTML and it gets mangled. Base64 converts the data into harmless characters so it survives those channels intact.
The cost is size: every 3 bytes become 4 characters, so the data grows by about 33%. That's why Base64 is a poor way to move large files.
Where you'll meet Base64
- Email attachments. MIME encodes attachments as Base64 wrapped at 76 characters — that's what the wrap option is for.
- data: URLs. Embedding an image straight into HTML or CSS uses
data:image/png;base64,…. - JWT (JSON Web Tokens). The first two dot-separated parts are URL-safe Base64 and anyone can read them.
- HTTP Basic authentication. The username and password are sent as
user:passwordin Base64 — not encrypted. - API keys and config files. Binary keys are written in Base64 so they fit in a text file.
Base64 is not encryption
This is the most common misunderstanding. Encryption involves a key, and without the key the data stays closed. Base64 has no key: anyone who sees the text can reverse it in seconds — including with this page.
In practice: a Base64-encoded password is a plaintext password. When you see Base64 in a config file, a URL or a message, don't treat it as secret. Data that genuinely needs hiding needs encryption.
Base64 doesn't guarantee integrity either. To check whether a file arrived unchanged, use the hash generator.
Standard, URL-safe and wrapped variants
| Variant | Difference | Used for |
|---|---|---|
| Standard | Uses + and /, ends with = padding | General purpose |
| URL-safe | Uses - and _, drops = | URLs, JWTs, file names |
| MIME (76) | Wraps lines at 76 characters | Email attachments |
When decoding, this tool accepts all three automatically: it converts - and _, restores missing padding and ignores line breaks. You don't have to think about where you copied it from.
Text is always handled as UTF-8, so accented letters and emoji come back exactly as they went in.
Glossary
- Base64
- An encoding that represents binary data as text using a safe 64-character alphabet.
- Padding
- The trailing
=characters, added to round the data up to a multiple of three bytes. - URL-safe Base64
- A variant using
-and_instead of+and/, with no padding. - data: URL
- A format that embeds a file's content directly in a URL, usually written in Base64.
Frequently asked questions
What is Base64?
An encoding that turns binary data into text made only of letters, digits and a couple of symbols, so that binary can travel safely through systems built for text — email, JSON, HTML.
Is Base64 encryption?
No. Encryption needs a key; Base64 needs nothing and anyone can reverse it. It is not suitable for storing passwords or personal data.
Is my file uploaded?
No. The file is read inside your browser and encoded there; its contents are never sent anywhere.
What is URL-safe Base64?
Standard Base64 uses + and /, which cause trouble inside URLs. The URL-safe variant uses - and _ instead and drops the trailing = padding. JWTs use this form.
Why is the result bigger than the original?
Base64 produces 4 characters for every 3 bytes, so size grows by about 33%. Line wrapping adds a few more characters.
Decoding gives me gibberish — why?
What you decoded probably isn't text but an image or another binary file. This tool shows decoded data as text, and binary files can't be read that way.
Do accented characters and emoji survive?
Yes. Text is encoded as UTF-8, so accented letters and emoji come back exactly as they went in.