Base64 Encode/Decode
Encode text to Base64 or decode Base64 strings back to plain text. Fast, free, and runs entirely in your browser.
How to Use
- Enter or paste your text in the input area
- Click Encode to convert to Base64, or Decode to convert from Base64
- Copy the result with the Copy button
Frequently Asked Questions
-
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is commonly used to embed images in HTML/CSS or transmit data over text-based protocols.
-
Is Base64 encryption?
No, Base64 is an encoding, not encryption. It does not provide any security. Anyone can decode a Base64 string back to its original form.
-
Does this tool support UTF-8?
Yes, this tool fully supports UTF-8 encoded text, including characters from all languages.
-
What is the maximum input size?
Since this tool runs in your browser, the limit depends on your device's memory. Typically it handles several megabytes without issues.
What Is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that converts arbitrary binary data into a string of 64 printable ASCII characters. The name comes from the 64-character alphabet used: uppercase A–Z, lowercase a–z, digits 0–9, and the symbols + and /. A = character is used for padding.
The core idea is simple: take every 3 bytes of binary data (24 bits) and represent them as 4 Base64 characters (each carrying 6 bits). This means Base64-encoded data is approximately 33% larger than the original.
Why Is Base64 Used?
Many protocols and storage systems were originally designed to handle text, not arbitrary binary data. Emails, for example, were built on protocols that only supported 7-bit ASCII. Embedding a binary file (like an image or a PDF) directly would corrupt it. Base64 solves this by encoding binary data as safe, printable text.
Common use cases include:
- Embedding images in HTML/CSS: Using
data:image/png;base64,...URIs to avoid a separate HTTP request. - JSON and XML payloads: Transmitting binary data (file uploads, encryption keys) within text-based API responses.
- HTTP Basic Authentication: Credentials are Base64-encoded before being sent in the
Authorizationheader (note: this is encoding, not encryption). - Email attachments (MIME): Attachments are Base64-encoded before being embedded in email bodies.
- Storing binary data in databases: Embedding small binary objects in text columns or NoSQL documents.
Base64 Is Not Encryption
This is a critical misconception. Base64 encoding is completely reversible without any key or secret. It provides zero security. Anyone who sees a Base64 string can decode it instantly. Never use Base64 to protect sensitive data — use proper encryption instead (AES, RSA, etc.).
URL-Safe Base64
Standard Base64 uses + and /, which are special characters in URLs. URL-safe Base64 replaces these with - and _, making the encoded string safe to use in query parameters and file paths without percent-encoding.
Practical Example
The string Hello in Base64 becomes SGVsbG8=. The trailing = is padding added because the input length (5 bytes) is not a multiple of 3.