Base64 Encoder / Decoder
Encode or decode text to and from Base64, including URL-safe mode and file-to-Base64 conversion with Unicode support.
Privacy: This tool runs entirely in your browser. Your data never leaves your device and is never uploaded to any server.
How to use this Base64 encoder
- Paste text to encode it, or drop a file to get its Base64 representation.
- Switch to decode mode to turn Base64 back into readable text or bytes.
- Turn on URL-safe mode when the result has to survive inside a URL or a filename.
- Copy the result with a single click.
Where Base64 shows up in practice
Once you start looking, Base64 is everywhere. These are the four or five places you are most likely to meet it, and what it is doing there.
| Context | What it is doing | Where you see it |
|---|---|---|
| Data URLs | Embeds an image or font directly in HTML or CSS | src="data:image/png;base64,..." |
| JSON Web Tokens | Encodes the header and payload for a URL-safe channel | The first two sections of a JWT |
| Email attachments | Carries binary files through a text-only protocol | The body of a MIME part |
| Basic authentication | Puts a user and password into a request header | Authorization: Basic ... |
| API payloads | Transports a small binary blob inside JSON | A file field in a JSON body |
What Base64 actually does
Base64 represents binary data using only 64 printable characters: A–Z, a–z, 0–9, plus two more that vary by variant. Every three bytes of input become four characters of output, which is why Base64 data is roughly a third larger than the original.
The point is not compression or secrecy — it is compatibility. Email, JSON, XML, HTML attributes and URLs are text formats and cannot carry raw bytes safely, so Base64 turns bytes into something that travels through them intact.
Base64 is not encryption
This is the mistake that causes real damage. Base64 is a reversible encoding with no key: anyone holding the string can decode it in a second. A credential, an API key or an obfuscated password that has merely been Base64-encoded is effectively stored in plain text.
If you need secrecy you need encryption, such as AES, or a secure transport like HTTPS. If you only need arbitrary bytes to survive a text channel, Base64 is the right tool.
Standard and URL-safe variants
- Standard Base64 uses + and /, both of which have meaning inside a URL.
- URL-safe Base64 swaps them for - and _ so the string can live in a query string or path.
- JSON Web Tokens use Base64URL, which also drops the = padding.
- If a decoder rejects a string that looks correct, the variant is usually why.
Does it handle Unicode?
Yes, and the order matters. Text is first encoded as UTF-8 bytes and then Base64-encoded, which is what lets emoji, accented characters and non-Latin scripts round-trip correctly. Decoding runs in the other direction: you get bytes back, and they have to be interpreted as UTF-8 to recover the original text.
Frequently asked questions
What is Base64?
Base64 is an encoding that represents binary data using 64 printable ASCII characters, often used to embed data in text formats.
Does this tool support Unicode?
Yes. Input is encoded as UTF-8 before Base64 conversion, so emoji and non-Latin characters round-trip correctly.
Is Base64 encryption?
No. Base64 is only an encoding. It can be decoded by anyone and provides no security or secrecy.
Does Base64 make data larger?
Yes, by about a third. Every three bytes of input become four characters of output, and padding adds a little more.
Why does my Base64 string end in equals signs?
Those are padding characters. Base64 works in groups of three bytes, and the equals signs fill out the final group when the input length is not a multiple of three.
Can a Base64 string contain line breaks?
The classic MIME form wraps at 76 characters, but most modern uses do not wrap at all. If a decoder fails on a long string, strip the whitespace first.
More Encoding & Hashing tools
URL Encoder / Decoder
Encode and decode URLs or URI components following RFC 3986, perfect for query strings, paths and shareable links.
Hash Generator
Generate MD5, SHA-1, SHA-256 and SHA-512 hashes using the Web Crypto API. Your input never leaves your browser.
JWT Decoder
Decode and inspect the header, payload and signature of a JSON Web Token, entirely in your browser.
HTML Entity Encoder / Decoder
Encode and decode HTML entities, with optional encoding of all non-ASCII characters.