Developer Tool

Base64 Encoder & Decoder

Convert text, images, and files to Base64 format instantly. Supports URL-safe encoding, Data URI generation, and real-time preview — completely free and private.

100% Client-Side
No Limits
🔒 Private

📥 Input (Text to Encode)

0 characters 0 bytes 0 lines

Drag & drop any file here

or

Max file size: 50MB • All file types supported

Drag & drop an image here

or

PNG, JPG, GIF, SVG, WebP, ICO

🌐

Note: URL must support CORS. For images, you can also right-click and copy the image directly.

Encoding Options

📤 Output (Base64)

0 characters 0 bytes +0% size

Powerful Base64 Features

Instant Conversion

Real-time encoding and decoding as you type. No server requests — everything runs in your browser.

📁

Any File Type

Support for all file formats including images, PDFs, documents, audio, video, and binary files.

🔗

URL-Safe Mode

Generate URL-safe Base64 strings that work in URLs and filenames without encoding issues.

🖼️

Data URI Support

Automatically generate Data URIs for embedding images directly in HTML, CSS, or JavaScript.

🔒

100% Private

All processing happens locally in your browser. Your data never leaves your device.

📋

Multiple Formats

Export as plain Base64, HTML img tag, CSS background, or Markdown image syntax.

Common Use Cases for Base64

🌐

Embed Images in HTML

Include small images directly in HTML without additional HTTP requests for faster page loads.

🎨

CSS Background Images

Embed icons and small graphics in CSS files to reduce the number of image requests.

📧

Email Attachments

Encode files for safe transmission through email systems that only support text content.

🔌

API Data Transfer

Send binary data through JSON APIs and web services that expect string values.

💾

Database Storage

Store small files and images as text in databases that don't support binary fields.

🔐

Authentication Tokens

Encode credentials and tokens for HTTP Basic Authentication and JWT payloads.

Base64 Character Set

Base64 uses 64 characters to represent binary data. Each character represents 6 bits of data.

Value Char Value Char Value Char Value Char
0A16Q32g48w
1B17R33h49x
2C18S34i50y
3D19T35j51z
4E20U36k520
5F21V37l531
6G22W38m542
7H23X39n553
8I24Y40o564
9J25Z41p575
10K26a42q586
11L27b43r597
12M28c44s608
13N29d45t619
14O30e46u62+
15P31f47v63/

Padding: The = character is used for padding when the input length is not divisible by 3.

URL-Safe: In URL-safe Base64, + becomes - and / becomes _

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /). It was designed to safely transmit binary data through systems that only support text, such as email or URLs.

The encoding works by taking 3 bytes (24 bits) of input and converting them into 4 Base64 characters (6 bits each). This makes the output approximately 33% larger than the input.

Is Base64 encryption?

No, Base64 is NOT encryption. It's simply an encoding scheme — a way to represent data differently. Anyone can decode Base64 data without any key or password.

If you need to secure your data, you should use proper encryption (like AES) first, then optionally Base64 encode the encrypted result for transmission.

Why does Base64 increase file size?

Base64 increases data size by approximately 33% because it encodes every 3 bytes of binary data into 4 ASCII characters. This overhead is the trade-off for being able to represent binary data as text.

  • 1 KB file → ~1.33 KB Base64
  • 1 MB file → ~1.33 MB Base64
  • 100 KB image → ~133 KB Base64
What is URL-safe Base64?

Standard Base64 uses + and / characters, which have special meanings in URLs. URL-safe Base64 replaces these:

  • + becomes - (hyphen)
  • / becomes _ (underscore)

This allows Base64 strings to be used in URLs, filenames, and other contexts where special characters might cause issues.

What is a Data URI?

A Data URI (or Data URL) is a way to embed small files directly in HTML, CSS, or JavaScript. The format is:

data:[mime-type];base64,[encoded-data]

For example, a small PNG image might look like:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAB...

This eliminates the need for a separate HTTP request to load the resource.

Is my data safe using this tool?

Yes, completely. All encoding and decoding happens locally in your web browser using JavaScript. Your data is never sent to our servers or any third party.

You can verify this by:

  • Using the tool offline (disconnect from internet)
  • Checking your browser's Network tab in Developer Tools
  • Reviewing the source code
What's the maximum file size supported?

The tool supports files up to 50MB. However, practical limits depend on your browser and device memory. For very large files:

  • Files under 5MB: Instant processing
  • Files 5-20MB: May take a few seconds
  • Files 20-50MB: May take longer, depends on device

For files larger than 50MB, consider using a command-line tool or splitting the file.

Can I decode Base64 images?

Yes! Simply paste the Base64 string (with or without the Data URI prefix) in Decode mode. The tool will automatically detect if it's an image and show a preview.

You can then download the decoded image file in its original format.