Base64 Encode & Decode
Runs entirely in your browser. Nothing you paste is uploaded or stored.
How to encode or decode Base64
- Choose Encode to turn text into Base64, or Decode to turn Base64 back into readable text.
- Type or paste into the left box. With Convert as I type on, the result updates instantly.
- Tick URL-safe if the value goes into a URL, a file name or a JWT. Decoding accepts both standard and URL-safe input automatically.
- To embed an image or any other file, click Encode a file. You get a ready-to-use
data:URI.
What is Base64?
Base64 is a way to write binary data using only 64 safe characters: A-Z, a-z, 0-9, + and /, with = as padding. It exists because many systems, such as email, JSON, HTML attributes and HTTP headers, were designed for text and can corrupt raw bytes. Encoding the bytes as Base64 lets them travel safely through those systems and be decoded on the other side.
Every 3 bytes of input become 4 characters of output, so Base64 data is about a third larger than the original. That trade-off is fine for small values like tokens, icons and credentials in headers, but not for large files.
Common uses
- HTTP Basic auth. The
Authorization: Basicheader carriesusername:passwordencoded in Base64. - Data URIs. Small images and fonts can be embedded straight into HTML or CSS as
data:image/png;base64,..., saving a request. - JWT tokens. The header and payload of a JSON Web Token are base64url-encoded JSON. Decode them here to inspect the claims.
- Email attachments. MIME encodes attachments in Base64 so they survive mail servers.
- APIs. Many APIs accept file uploads as Base64 strings inside a JSON body.
Base64 is not encryption
Anyone can decode Base64 in a second, so it gives no protection at all. Never use it to hide passwords, API keys or personal data. If you need secrecy, use real encryption and always send data over HTTPS.
Unicode and emoji
The browser's built-in btoa() function fails on characters outside Latin-1, such as emoji or Urdu text. This tool converts text to UTF-8 bytes first, so Salam ๐ or ุณูุงู
encode and decode correctly. If you decode Base64 that holds binary data rather than text, you will see a warning instead of garbled characters.
Receiving form data without a server
If you only need visitors to send you a message from your website, you do not have to encode or decode anything yourself. A hosted form backend like formvoxo receives normal HTML form posts and emails each submission to you. See how it works.
Want the full guide? Read Base64 Encoding Explained: How It Works and When to Use It.
Frequently asked questions
Is Base64 encryption? +
No. Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or secrets.
Why is the Base64 output bigger than the input? +
Base64 represents every 3 bytes as 4 characters, so the output is about 33% larger than the original data.
What is URL-safe Base64 (base64url)? +
It replaces + with - and / with _ and usually drops the = padding, so the result can be used in URLs, file names and JWT tokens without escaping.
Does it handle emoji and non-English text? +
Yes. Text is converted to UTF-8 bytes before encoding and decoded back as UTF-8, so emoji, Arabic, Urdu, Chinese and accented characters survive the round trip.
Are my files uploaded? +
No. Files are read locally with the browser FileReader API and never leave your device.
More free tools
Need a backend for your HTML forms?
Point any form at formvoxo and get submissions in your inbox, with spam filtering built in. Free plan, no server code.
Create free account โ