Base64 Encoder & Decoder – Free Online Tool
Encode text to Base64 or decode Base64 to text. Also supports image and file encoding.
Drag & drop an image or click to browse
Supports JPG, PNG, GIF, WebP
Drag & drop a file or click to browse
Any file type supported
How to Use Base64 Converter
- Select the tab for your input type (Text, Image, or File)
- Enter text or upload a file
- Click Encode to convert to Base64, or Decode to convert from Base64
- Copy the result
What is Base64?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It's commonly used for:
- Email: Encoding attachments
- Data URLs: Embedding images in HTML/CSS
- APIs: Transmitting binary data in JSON
- Authentication: Basic HTTP authentication
Features
- Text Encoding: Convert any text to Base64
- Text Decoding: Convert Base64 back to text
- Image Support: Get data URLs for images
- File Support: Encode any file type
- Privacy: All processing in your browser
How Base64 Encoding Works
Base64 divides the input into groups of three bytes (24 bits). Each group is then split into
four 6-bit values, and each 6-bit value is mapped to one of 64 printable ASCII characters:
A–Z, a–z, 0–9, +, and /. If the input length is not a multiple
of three, padding characters (=) are added to the output.
Because every 3 bytes become 4 characters, the encoded output is roughly 33 % larger than the original data. This size increase is the trade-off for being able to safely embed binary content in text-based protocols.
Common Real-World Uses
- Data URIs: Embed small images directly in HTML or CSS using
data:image/png;base64,...to reduce HTTP requests. - Email attachments (MIME): Email protocols are text-based, so binary attachments are Base64-encoded before transmission.
- API payloads: Binary data like PDF files or images can be included in JSON API requests by encoding them as Base64 strings.
- HTTP Basic Authentication: The username and password are combined and Base64-encoded in the Authorization header.
- Cryptographic tokens: JWTs (JSON Web Tokens) use Base64url encoding for their header and payload sections.
Base64 vs. Base64url
Standard Base64 uses + and / as special characters, plus =
for padding. These characters can cause issues in URLs and filenames. Base64url replaces
+ with -, / with _, and often omits padding.
It is used in JWTs and URL-safe contexts.
Important: Base64 Is Not Encryption
Base64 encoding is fully reversible by anyone—it provides no security or confidentiality. Never use Base64 to protect sensitive data like passwords or API keys. If you need to secure data, use proper encryption such as AES-256. Our Secure Notes tool offers AES-GCM encryption for sensitive text.
Limitations
Very large files (over 10 MB) may be slow to encode depending on your device. The resulting Base64 string will be ~33 % larger than the original file. For binary data that needs to stay compact, consider alternative approaches like direct file upload instead of Base64 encoding.
Frequently Asked Questions
Base64 is a binary-to-text encoding scheme that converts binary data into a set of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is widely used to embed binary data in text-based formats like JSON, XML, HTML, and email.
Base64 represents every 3 bytes of input as 4 ASCII characters, so the encoded output is approximately 33 % larger than the original binary data. This overhead is the trade-off for being able to safely transmit binary content through text-only channels.
No. Base64 is an encoding scheme, not encryption. Anyone can decode a Base64 string back to the original data without a key. It provides no security or confidentiality—it is purely a format conversion.
Yes. All encoding and decoding happens entirely in your browser. Your text, images, and files are never uploaded to our servers.