This website uses cookies to improve your experience. By using our site, you agree to our Cookie Policy.

Base64 Encoder & Decoder

Encode or decode text, URLs, files & images to Base64 instantly. 100% browser-based — your data never leaves your device.

0 B
Input Size
0 B
Output Size
Size Ratio
0
Input Chars
Text
URL
Image → Base64
Base64 → Image
File
URL-Safe
Line Wrap
Wrap at
Encoding
Input Text PLAIN TEXT
Base64 Output BASE64
Invalid Base64 string. Please check your input.
Copied!

Common Uses

Embed Images in HTML/CSS

Convert images to Base64 to embed directly in HTML or CSS — no separate image file needed.

API Authentication

Encode credentials for HTTP Basic Auth headers in API requests and REST integrations.

Email Attachments

MIME email protocol uses Base64 to encode file attachments for safe text-based transmission.

JWT Tokens

JWT tokens use URL-safe Base64 encoding. Decode any JWT payload to inspect claims instantly.

Data URIs

Use Base64-encoded images as data URIs in src attributes to reduce HTTP requests on web pages.

Config Files

Store binary data or special characters safely in JSON, YAML and environment variable config files.

How to Use the Base64 Encoder Decoder

Convert text to Base64 format or decode Base64 strings back into readable text quickly and securely using this free online tool.

Choose Mode

Select "Encode to Base64" to convert plain text, or "Decode from Base64" to get the original text back.

Select Type

Pick Text, URL, Image→Base64, Base64→Image, or File depending on what you want to process.

Set Options

Toggle URL-safe mode for JWT/URLs, or enable line wrapping at 64/76 chars for MIME/PEM format.

Copy or Download

Copy the output to clipboard or download as a .txt file. For images, copy as data URI or raw Base64.

Frequently Asked
Questions

1. What is Base64 encoding and how does it work?
Base64 is a binary-to-text encoding scheme that converts binary data into a safe ASCII string using 64 characters (A–Z, a–z, 0–9, +, /). It’s commonly used to safely transmit binary data over text-based systems like email, JSON APIs, and HTML attributes. Every 3 bytes of input becomes 4 Base64 characters, which is why Base64 output is ~33% larger than the original.
Standard Base64 uses + and / characters which have special meanings in URLs. URL-safe Base64 replaces + with – and / with _ so the encoded string can be safely used in URLs, query parameters, and JWT tokens without percent-encoding.
Standard Base64 uses + and / characters which have special meanings in URLs. URL-safe Base64 replaces + with – and / with _ so the encoded string can be safely used in URLs, query parameters, and JWT tokens without percent-encoding.
Base64 encodes every 3 bytes (24 bits) into 4 characters (6 bits each). This means Base64 output is always approximately 33% larger than the original input. For images embedded as Base64 in HTML/CSS, this size increase is the trade-off for eliminating a separate HTTP request.
No — Base64 is encoding, not encryption. It provides zero security. Anyone can decode a Base64 string instantly. Never use Base64 to hide sensitive data like passwords. Use it only for data format conversion, never for security purposes.
Yes! This tool supports JPG, PNG, GIF, WebP, SVG, and BMP images. The output includes the complete data URI with the correct MIME type (e.g., data:image/png;base64,…) which can be used directly in HTML img src attributes or CSS background-image properties.
Absolutely nothing is sent to any server. All encoding, decoding, and image processing happens 100% in your browser using JavaScript. Your text, files, and images never leave your device. Complete privacy guaranteed.

Let's Talk