Base64 is a way of writing any data, whether text, images or binary files, using only 64 “safe” characters: A–Z, a–z, 0–9, + and /, with = for padding. This tool encodes text to Base64 and decodes Base64 back to readable text. It has full UTF-8 support, so Hindi, Marathi, Tamil, emoji and other non-English characters come through correctly. Everything happens in your browser and nothing is uploaded.
How to use the Base64 encoder / decoder
- Choose the Encode or Decode tab.
- Paste your text, or your Base64 string, into the input box.
- Press the button and copy the result.
If decoding fails, the input probably isn’t valid Base64. Check for missing padding, stray spaces or URL-safe characters (see below).
How Base64 encoding works
Base64 takes the input 3 bytes (24 bits) at a time, splits them into four 6-bit groups, and maps each group (0–63) to a character:
When the input length isn’t a multiple of 3, = padding fills the gap: “Ma” → TWE=, and “M” → TQ==.
Examples
Hello→SGVsbG8=नमस्ते(UTF-8, 18 bytes) →4KSo4KSu4KS44KWN4KSk4KWH
Size overhead
Base64 makes data about 33% larger: every 3 bytes become 4 characters. A 300 KB image becomes about 400 KB when Base64-encoded. That is why embedding large images as data URIs in HTML or CSS slows pages down.
Where Base64 is used
| Use | Example |
|---|---|
| Email attachments | MIME encodes attachments in Base64 so they survive text-only mail systems |
| Data URIs | <img src="data:image/png;base64,iVBORw0..."> for tiny icons |
| HTTP Basic Auth | Authorization: Basic dXNlcjpwYXNz (that is just “user:pass”) |
| JSON Web Tokens (JWT) | Header and payload are Base64URL-encoded JSON |
| APIs | Sending files or binary data inside JSON fields |
| Kubernetes Secrets, certificates (PEM) | Values and keys stored as Base64 text |
Base64 is not encryption
Base64 vs Base64URL
Standard Base64 uses + and /, which have special meanings in URLs and file names. Base64URL (RFC 4648 §5) replaces them with - and _ and usually leaves out the = padding. JWTs use Base64URL. To decode a Base64URL string here, change - back to + and _ back to /, and add = until the length is a multiple of 4.
Why the UTF-8 handling matters
The browser’s built-in btoa() function only accepts Latin-1 characters and throws an error on text like “₹” or “मराठी”. This tool converts text to UTF-8 bytes first and then encodes it, which is what servers and other languages (Python, Java, Node.js) expect. The decoded output matches what those systems produce.
Working with JSON payloads? Format them with the JSON Formatter.
Frequently asked questions
What is Base64 encoding used for?
It represents binary or special-character data as plain ASCII text, so the data can travel safely through email, URLs, JSON, HTML and HTTP headers.
Is Base64 encryption?
No. Base64 is a reversible encoding with no key. Anyone can decode it, so it gives no security on its own.
Why does my Base64 string end with = or ==?
The = signs are padding. They appear when the input length isn’t a multiple of 3 bytes: one = when there are 2 leftover bytes and two == when there is 1.
Can I encode Hindi or emoji in Base64?
Yes. This tool encodes text as UTF-8 first, so any Unicode text, including Devanagari scripts and emoji, encodes and decodes correctly.
Why is the Base64 output bigger than the input?
Base64 turns every 3 bytes into 4 characters, which makes data about 33% larger.