Skip to main content
Developer Tools

Free Base64 Encoder

New Popular

Free online Base64 encoder. Convert text, images, files, and URLs to Base64 format instantly. Supports UTF-8, ASCII, URL-safe encoding, data URI generation, JWT decoding, encoding comparison (Base32, Hex), QR code output, and file-to-Base64 conversion.

Base64 Encoder
Input (Plain Text)
Original: 0 B → Base64: 0 B
Output (Base64)

How to Use

1
Choose Your Input Type

Select the Text tab for plain text, Image for pictures, File for any file type, Batch for multiple values at once, or JWT Decoder to inspect tokens.

2
Enter or Upload Your Content

Type or paste text directly into the input field, or drag-and-drop a file. The tool encodes to Base64 in real-time as you type — no button needed.

3
Customize the Output

Toggle URL-Safe encoding for web-friendly output (replaces + and / with - and _), add line breaks for MIME or PEM compatibility, or change the character encoding for non-English text.

4
Copy in Your Preferred Format

Copy the raw Base64 string, a complete data URI, an HTML img tag, or a CSS background-image rule. Download the result or generate a QR code for easy sharing.

What Is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts any binary data into a sequence of printable ASCII characters drawn from a 64-character alphabet: A–Z, a–z, 0–9, plus (+) and slash (/). Every 3 bytes of input become 4 Base64 characters — which means Base64 output is approximately 33% larger than the original.

Why Use Base64?

  • Data URIs in HTML/CSS — Embed images, fonts, and icons directly in your HTML or CSS without a separate HTTP request. Ideal for small assets in critical rendering paths.
  • Email attachments (MIME) — Email protocols are text-only. Base64 is the standard method for encoding binary attachments such as PDFs, images, and ZIP files before transmission.
  • HTTP Basic Authentication — Credentials are encoded as Base64 in the Authorization header: Basic dXNlcjpwYXNz. (Note: this is not encryption — use HTTPS for security.)
  • JSON and XML payloads — APIs sometimes return binary data (certificates, signatures, images) encoded in Base64 inside JSON or XML fields.
  • JWT tokens — JSON Web Tokens encode their header and payload as URL-safe Base64 (Base64URL), which replaces + with -, / with _, and omits padding.

URL-Safe Base64

Standard Base64 uses the characters + and / which have special meaning in URLs and file systems. URL-Safe Base64 replaces these with - and _, and optionally removes padding =. This variant is essential for JWT tokens, URL query parameters, cookie values, and filename-safe encoding.

Image and File Encoding

Upload any image to generate four ready-to-use formats instantly: the raw Base64 string, a complete data URI, an HTML <img> tag with the data URI as its src, and a CSS background-image rule. For other file types, the File tab encodes any binary file (PDF, ZIP, DOCX, EXE) to Base64 with one click.

Privacy

All encoding, image processing, and file conversion happens entirely in your browser using JavaScript. Your text, files, and images never leave your device — nothing is uploaded, stored, or logged.

Frequently Asked Questions

Base64 is a method of converting binary data into a text format using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is used to safely transmit binary data through text-only systems such as email (MIME) and HTML/CSS (data URIs). Every 3 bytes of input become 4 Base64 characters.

Base64 converts every 3 bytes into 4 characters because it uses only 6 bits per character instead of 8. The encoded output is always 4/3 (133%) the size of the original input. This overhead is the trade-off for universal ASCII text compatibility.

Standard Base64 uses + and / characters which carry special meaning in URLs. URL-Safe Base64 replaces these with - and _, and typically removes padding = characters. This variant is used in JWT tokens, URL parameters, cookie values, and any context where the encoded string must be URL-safe without percent-encoding.

Yes. Upload any image using the Image tab (JPG, PNG, GIF, SVG, WebP) and instantly get four copy-ready formats: raw Base64, a data URI, an HTML img tag, and a CSS background-image rule. This lets you embed images directly in HTML or CSS without separate HTTP requests — useful for small icons and critical above-the-fold assets.

The tool supports UTF-8 (recommended for most use cases, handles all Unicode including emoji and CJK characters), ASCII (7-bit, English characters only), ISO-8859-1 (Western European, Latin-1), and UTF-16 (wide characters, includes BOM). For non-English text such as Arabic, Chinese, or Japanese, always use UTF-8.

MIME standard (RFC 2045) requires Base64 to have line breaks every 76 characters — this is used in email encoding. PEM standard (RFC 7468) uses 64 characters per line — this format is used in SSL/TLS certificates, RSA keys, and other cryptographic key files. Enable Line Breaks and select the appropriate length for your use case.

No. Base64 is encoding, not encryption. Anyone can decode a Base64 string without a key — it provides zero security or confidentiality. Never use Base64 alone to protect sensitive data like passwords or API keys. For security, use proper encryption (AES, RSA) and only optionally encode the encrypted output as Base64 for transmission.

No. All encoding is performed entirely in your browser using JavaScript. Your text, files, and images never leave your device — nothing is sent to any server, stored, or logged. You can safely use this tool with sensitive content such as API keys, private keys, and personal data.