Base64 Encoder / Decoder β Text & File Encoding Online
Encode or decode Base64 strings instantly β supports plain text, Unicode, and file upload up to 2 MB. 100% browser-based, your data never leaves your device.
What Is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that converts arbitrary binary data β or any string of bytes β into a sequence of 64 printable ASCII characters: AβZ, aβz, 0β9, +, and /, with = used as padding. The name comes from the 64 characters in its alphabet.
The core reason Base64 exists is that many systems β email (MIME), HTTP headers, HTML data URIs, JSON payloads, and configuration files β were designed for text, not arbitrary binary data. Encoding binary as Base64 makes it safe to transmit through these channels without corruption. Every 3 bytes of binary input become exactly 4 Base64 characters, which means encoded output is roughly 33% larger than the original.
You encounter Base64 constantly in web development: images embedded in CSS as data:image/png;base64,β¦, JWT tokens (which are three Base64url-encoded sections joined by dots), API keys stored in environment variables, and SSH public keys all use Base64 encoding.
Base64 vs Base64url β What's the Difference?
Standard Base64 uses + and /, which are special characters in URLs. Base64url is a URL-safe variant that replaces + with - and / with _, and omits the padding = character. JWT tokens use Base64url. This tool produces standard Base64 β if you need Base64url, replace +β- and /β_ in the output.
How to Encode or Decode Base64
- Text tab: Paste your plain text or Base64 string into the input box, then click Encode to Base64 or Decode from Base64.
- File tab: Drag and drop any file (up to 2 MB) onto the drop zone, or click to browse. The tool reads the file and outputs its Base64 representation instantly β useful for embedding images, fonts, or binary assets.
- Swap: Use the Swap button to move the output back into the input field for further processing.
FAQ
Frequently Asked Questions
Related Tools
- Format and validate API responses with our JSON Formatter & Validator.
- Decode percent-encoded URL strings with our URL Encoder / Decoder.
- Convert Unix timestamps found in API payloads with our Unix Timestamp Converter.