Base64 encoding is one of the most common operations in web development. Whether you're embedding images in CSS, debugging API tokens, or working with email attachments, a reliable Base64 encoder/decoder is an essential tool.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It uses 64 characters (A�Z, a�z, 0�9, +, /) plus = for padding.
The encoding process takes 3 bytes of binary data and converts them into 4 ASCII characters. This means Base64-encoded data is about 33% larger than the original binary.
For example:
Original: "Hello, World!"
Encoded: "SGVsbG8sIFdvcmxkIQ=="
Common Use Cases
Base64 encoding shows up in many places in web development:
- Data URIs � embedding small images, fonts, or files directly in HTML or CSS
- API authentication � HTTP Basic Auth sends credentials as Base64-encoded strings
- JWT tokens � JSON Web Tokens use Base64URL encoding for header and payload
- Email attachments � MIME encoding uses Base64 for binary file attachments
- Configuration files � Kubernetes secrets, environment variables, and config maps
- Source maps � encoded inline in JavaScript files
How to Use the Base64 Tool
The free Base64 encoder/decoder at DevUtils makes encoding and decoding effortless:
- Open DevUtils and click the Base64 tab
- Paste your text into the input box
- Click Encode to convert text to Base64, or Click Decode to convert Base64 back to text
- Copy the result with one click
All processing is done locally in your browser. Your data is never sent anywhere.
How Base64 Works (Under the Hood)
Understanding the mechanics helps you know when to use Base64 and when not to:
- The input bytes are divided into groups of 3 bytes (24 bits)
- Each group is split into 4 chunks of 6 bits
- Each 6-bit chunk maps to a character in the Base64 alphabet (A�Z, a�z, 0�9, +, /)
- If the input isn't divisible by 3, padding characters (
=) are added
For URLs, use Base64URL encoding, which replaces + with - and / with _ and omits padding.
Creating Data URIs with Base64
One of the most practical uses of Base64 is creating data URIs � embedding small files directly in your HTML or CSS:
/* Before: external image */
background-image: url('logo.png');
/* After: inline data URI */
background-image: url('data:image/png;base64,iVBORw0KGgo...');
This eliminates an HTTP request, which is useful for small icons and decorative images. However, avoid data URIs for large files since Base64 increases size by ~33%.
Base64 & Security
A common misconception: Base64 is not encryption. It's an encoding scheme � easily reversible by anyone. Never use Base64 as a way to "hide" or "protect" sensitive data.
- Base64 encodes data for transport � it doesn't encrypt it
- Anyone can decode Base64 � there's no key or secret involved
- For sensitive data, use proper encryption (AES, RSA) instead
- Use HTTPS to protect data in transit
Try the Base64 Encoder/Decoder
Free, instant, and private. Encode or decode Base64 in your browser.
Open Base64 Tool