Convert text to Base64 and decode Base64 strings instantly with our free online tool
Transform any text into Base64 encoded format or decode Base64 strings back to readable text with our free online Base64 encoder and decoder tool. This utility is essential for developers working with data encoding, API authentication, email attachments, data URIs, and secure data transmission. Whether you need to encode binary data for web transfer or decode Base64 strings from APIs, our tool handles it all seamlessly with support for UTF-8 and special characters.
Perfect for encoding images and files for data URIs, working with HTTP Basic Authentication headers, debugging Base64-encoded API responses, processing email attachments, and preparing data for URL-safe transmission. The tool provides real-time encoding and decoding, displays detailed statistics including byte size and character count, and handles Unicode characters correctly. All processing happens locally in your browser with no data sent to external servers, ensuring complete privacy and security for sensitive information.
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It works by converting binary data into a set of 64 different ASCII characters (A-Z, a-z, 0-9, +, and /), making it safe to transmit over text-based protocols like HTTP, email, and JSON. Base64 encoding increases the data size by approximately 33%, but ensures that binary data can be safely embedded in text formats without corruption or misinterpretation by systems that only handle text.
Common uses include embedding images in HTML and CSS using data URIs (data:image/png;base64,...), encoding binary files for JSON APIs, implementing HTTP Basic Authentication (Authorization: Basic base64credentials), sending file attachments in emails, and storing binary data in text-based databases. Base64 decoding reverses this process, converting the encoded ASCII string back to its original binary format or text representation.
Data URIs & Image Embedding: Encode images, fonts, and other binary files as Base64 to embed them directly in HTML, CSS, or SVG files. Creates data URIs like data:image/png;base64,iVBORw0KG... for inline resources without external file requests.
HTTP Basic Authentication: Encode username and password combinations for Basic Auth headers in API requests. The format username:password is Base64 encoded and sent as Authorization: Basic base64string in HTTP headers.
API Data Transmission: Encode binary data, files, or complex strings for safe transmission through REST APIs, webhooks, and web services that only accept text-based JSON or XML formats.
Email Attachments: MIME email protocols use Base64 encoding to transmit binary file attachments as text within email messages, ensuring compatibility across different email systems and servers.
Database Storage: Store binary data like images, PDFs, or encrypted content in text-based database fields. Base64 encoding allows binary data to be safely stored in VARCHAR or TEXT columns.
URL-Safe Data Transmission: Encode data for safe transmission in URLs and query parameters. Base64 ensures special characters do not break URL parsing or cause encoding issues in web applications.
Cryptography & Security: Encode encrypted data, security tokens, hashed values, and digital signatures for transmission and storage. Base64 is commonly used with JWT tokens, OAuth, and API keys.
Base64 uses a specific set of 64 characters to represent binary data: uppercase letters A-Z (26 characters), lowercase letters a-z (26 characters), digits 0-9 (10 characters), and two special characters plus (+) and forward slash (/). The equals sign (=) is used as padding to ensure the output length is a multiple of 4 characters. This character set was chosen because these ASCII characters are universally supported across all text-based systems and protocols.
When you see a Base64 string like SGVsbG8gV29ybGQh, each character represents 6 bits of data. Four Base64 characters encode three bytes of original data, which is why Base64 encoding increases size by approximately 33%. The padding characters (=) at the end indicate how many bytes of the original data the last group represents, ensuring proper decoding without data loss.