Base64 Encoder/Decoder Tool
Encode and decode Base64 data instantly. Convert text, files, or binary data to Base64 format or decode Base64 strings back to their original form.
🔒 Working with sensitive text or files online? NordVPN keeps your connection private and encrypts it in one click — Hide My Activity and Secure My Connection →
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It uses 64 different characters (hence the name) to represent data:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 + /
(Plus padding character: =)
Base64 encoding increases the data size by approximately 33% because it represents 3 bytes of binary data using 4 ASCII characters. This trade-off allows binary data to be safely transmitted through systems that only support text.
Original Text:
Hello WorldBase64 Encoded:
SGVsbG8gV29ybGQ=Back to Original:
Hello World
How Base64 Encoding Works
- Binary Conversion: Text is first converted to binary (8-bit bytes).
- Grouping: Binary data is divided into groups of 6 bits each.
- Mapping: Each 6-bit group is mapped to one of the 64 Base64 characters.
- Padding: If the input isn’t a multiple of 3 bytes, padding characters (=) are added.
Text: "A"ASCII: 65Binary: 010000016-bit groups: 010000 01Padded: 010000 010000 (padding needed)Base64: QQ==
Common Use Cases for Base64
🖼️ Embedding Images
Embed images directly in HTML, CSS, or JSON using Data URIs. Great for small icons and logos to reduce HTTP requests.
data:image/png;base64,iVBOR...
📧 Email Attachments
MIME (Multipurpose Internet Mail Extensions) uses Base64 to encode email attachments for safe transmission.
🔐 Basic Authentication
HTTP Basic Authentication encodes credentials in Base64 format in the Authorization header.
Authorization: Basic dXNlcjpwYXNz
🔄 API Data Transfer
Transfer binary data (PDFs, images, files) through JSON APIs that only support text.
💾 Data Storage
Store binary data in text-based formats like XML, JSON, or databases that don’t support binary.
🌐 Web Tokens
JWT (JSON Web Tokens) use Base64url encoding to encode token headers and payloads.
How to Use the Base64 Encoder/Decoder
Encoding Text to Base64:
- Enter or paste your plain text in the text area.
- Click the “Encode to Base64” button.
- The encoded Base64 string will appear in the same text area.
- Click “Copy Result” to copy it to your clipboard.
Decoding Base64 to Text:
- Paste your Base64 encoded string in the text area.
- Click the “Decode from Base64” button.
- The decoded text will appear in the text area.
- Click “Copy Result” to copy the decoded text.
Type “Hello World” and click Encode. You’ll get:
SGVsbG8gV29ybGQ=Then click Decode to get back:
Hello World
Base64 vs Other Encoding Methods
| Encoding Type | Characters Used | Use Case | Size Increase |
|---|---|---|---|
| Base64 | A-Z, a-z, 0-9, +, / | Email, Data URIs, APIs | ~33% |
| Base64url | A-Z, a-z, 0-9, -, _ | URLs, Filenames, JWT | ~33% |
| Hexadecimal | 0-9, A-F | Color codes, Hashes | 100% |
| URL Encoding | %, 0-9, A-F | URLs only | Varies |
Frequently Asked Questions
Base64 Encoding Examples
| Original Text | Base64 Encoded |
|---|---|
| Hello World | SGVsbG8gV29ybGQ= |
| user:password | dXNlcjpwYXNzd29yZA== |
| [email protected] | YWRtaW5AZXhhbXBsZS5jb20= |
| Base64 Encoding! | QmFzZTY0IEVuY29kaW5nIQ== |
| 🎉 Emoji test 😀 | 8J+OiSBFbW9qaSB0ZXN0IPCfmIA= |
| 123456789 | MTIzNDU2Nzg5 |
Practical Examples
1. Data URI for Images
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA..." alt="Small icon">
2. HTTP Basic Authentication
username:passwordBase64:
dXNlcm5hbWU6cGFzc3dvcmQ=Header:
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
3. JSON with Binary Data
{
"filename": "document.pdf",
"content": "JVBERi0xLjQKJeLjz9MKMSAwIG9iago8PC9UeXB..."
}
Remove Backslashes From Text ✅ Online Case Converter Tool 2026
📝 Easily remove backslashes from your text with our free online Backslash Remover tool. ✅ Paste your text, click convert, and get clean results instantly.
CSS Beautifier & Code Fixer
Our CSS Beautifier & Code Fixer is a simple tool designed to help you with that. It works like a 2-in-1 helper: it not only...
Schema Markup Generator
Schema Markup Generator Build valid JSON-LD structured data — FAQ, Article, Product, Breadcrumb, Local Business, or Review schema — by filling in a simple form....
Remove Greater Than Sign From Text ✅ Online Case Converter 2026
😀 Online Case Convert Tool ☞ Remove Greater Than Sign From Text, underline, dots and commas, brackets