How to use: Base64 encode / decode
- 1Choose Encode to turn text into Base64, or Decode to turn Base64 back into text.
- 2Type or paste your input. The result updates as you type.
- 3For URLs, filenames and tokens, tick URL-safe to use - and _ instead of + and /.
- 4Copy the result, or press Swap to send it back the other way.
What Base64 is used for
Base64 turns any data into plain letters, digits and a few symbols, so it can travel safely through systems built for text:
- Data URLs that embed small images in HTML or CSS
- Email attachments (MIME)
- API payloads carrying files inside JSON
- Basic authentication headers (
Authorization: Basic …) - JWTs, whose header and payload are Base64URL
Size overhead
Base64 output is about 33% larger than the input, because every 3 bytes become 4 characters. That’s why sending large files as Base64 in JSON is slower than a normal upload.
Examples
| Text | Base64 |
|---|---|
hello |
aGVsbG8= |
नमस्ते |
4KSo4KSu4KS44KWN4KSk4KWH |
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding, not encryption. Anyone can decode it instantly. Never use it to hide passwords or secrets.
Why do other tools break on Hindi or emoji?
The browser's built-in btoa function only handles Latin characters. NapTools first converts text to UTF-8 bytes, so every language and emoji round-trips correctly.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in URLs. Base64URL replaces them with - and _ and usually drops the = padding. JWTs use Base64URL.
It says my Base64 decodes to binary data. What does that mean?
The input is valid Base64, but it contains a file such as an image or PDF rather than text, so it can't be shown as text.