Base64 Encoder/Decoder
Encode and decode text to Base64 instantly. Free, secure tool with no limits. Bidirectional conversion with full Unicode and special character support.
Text will be encoded to Base64
Error :
Base64 Encoder/Decoder: Convert Your Data Securely
Encode and decode text to Base64 instantly with our free online tool. Whether you need to prepare data for an API, encode HTTP credentials, or simply obfuscate text, this Base64 encoder handles all your conversions with full Unicode and special character support.
Base64 is an encoding system that converts binary data to ASCII text, enabling safe transmission through protocols that only accept text (email, JSON, XML, URLs). Our tool works 100% in your browser, ensuring your sensitive data never leaves your machine.
How to Use
- Select the mode: "Encode" (text โ Base64) or "Decode" (Base64 โ text)
- Paste or type your text in the input area
- The conversion happens automatically in real-time
- View the result in the output area
- Click the copy button to copy the result
๐ก Why Use an Online Base64 Encoder?
Base64 is ubiquitous in modern web development: HTTP Basic authentication, Data URLs for embedding images, file transmission via JSON, token storage... Yet encoding/decoding Base64 manually or through scripts can be tedious, especially for quick checks or debugging.
This tool solves that problem by offering an instant and secure interface for all your Base64 conversions. No need to open a Node.js or Python console just to verify a JWT token or decode an HTTP header.
๐ฏ Typical Use Case:
You receive a 401 error with a WWW-Authenticate: Basic realm="..." header. You need to encode your credentials in username:password format to Base64 for the Authorization header. A few seconds with this tool is all it takes.
๐ง Practical Use Cases
๐ HTTP Basic Authentication
Encode your credentials in username:password format for HTTP Basic authentication.
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
๐ผ๏ธ Data URLs (Embedded Images)
Convert small images to Base64 to embed them directly in your HTML/CSS.
<img src="data:image/png;base64,iVBORw0KG..." />
๐ซ JWT Token Decoding
JWT tokens consist of 3 Base64 parts. Decode the header and payload to inspect their content.
eyJhbGciOiJIUzI1NiJ9 โ {"alg":"HS256"}
๐ง MIME Encoding for Emails
Email attachments use Base64 to encode binary files within the message body.
Content-Transfer-Encoding: base64
๐ Configuration Obfuscation
Encode API keys or sensitive configs (โ ๏ธ this is NOT encryption, just obfuscation).
CONFIG_KEY=base64(secret_value)
๐ก JSON Data Transmission
JSON doesn't support binary. Encode your files in Base64 to transmit them via REST API.
{"file": "data:application/pdf;base64,..."}
โจ Why Use This Base64 Encoder?
โ๏ธ Bidirectional Conversion
Switch instantly between encode and decode mode with a simple button.
๐ Full Unicode Support
Correctly handles UTF-8 characters, emojis and special characters (รฉ, รฑ, ไธญๆ, ๐).
๐ 100% Private & Local
No data sent to any server. Perfect for encoding credentials or sensitive data.
โก Instant
Real-time conversion, even for long texts. No network latency.
๐จ Error Detection
Automatic Base64 validation in decode mode with clear error messages.
๐ Quick Copy
Automatic copy button to save time in your workflow.
โ Frequently Asked Questions (FAQ)
What is Base64 and how does it work?
Base64 is an encoding scheme that converts binary data to ASCII text using 64 characters: A-Z, a-z, 0-9, + and /.
The principle: each group of 3 bytes (24 bits) is divided into 4 groups of 6 bits. Each 6-bit group (0-63) maps to a character.
Example: "Man" โ "TWFu"
M(77)=01001101, a(97)=01100001, n(110)=01101110
โ 010011|010110|000101|101110 โ T|W|F|u
Is Base64 secure for passwords?
โ ๏ธ NO! Base64 is an encoding, not encryption. It decodes instantly.
To secure passwords: use hashing (bcrypt, Argon2) or encryption (AES).
Why does Base64 increase size by 33%?
3 bytes become 4 characters. Calculation: 4/3 = 1.33 or +33%.
Example: 300 KB โ 400 KB (+100 KB)
How do I decode a JWT token?
A JWT has 3 parts separated by dots: header.payload.signature
- Split at the dots
- Decode part 1 (header) โ algorithm
- Decode part 2 (payload) โ user data
- โ ๏ธ Part 3 (signature) is binary
Base64 vs Base64URL: what's the difference?
Base64: uses + and / (standard)
Base64URL: uses - and _ (URL-safe, for JWT/cookies)
How are Unicode characters handled?
This tool automatically handles UTF-8 before Base64 encoding, preserving emojis and special characters.
How do I integrate Base64 in my code?
JavaScript:
btoa('Hello') // Encode
atob('SGVsbG8=') // Decode
Python:
import base64
base64.b64encode(b'Hello').decode()
PHP:
base64_encode('Hello');
base64_decode($encoded);
๐ Base64 Best Practices
Use Base64URL for URLs
The + and / characters cause problems in URLs.
Never use Base64 for security
Base64 is NOT encryption. Use HTTPS/TLS.
Watch image sizes
2 MB โ 2.66 MB in Base64. Prefer direct URLs.
Validate Base64 server-side
Regex: ^[A-Za-z0-9+/]*={0,2}$
๐ Resources & Documentation
๐ RFC 4648 - Base64 Specification
Official document defining Base64, Base64URL, Base32.
Read the RFC โ