Input
Drop file here to convert to Base64
Output
Base64 image preview
Ready

Free Online Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 strings back to plain text instantly with this free online tool. Convert files and images to Base64 data URIs, toggle URL-safe mode, and preview embedded images. No signup, no data stored on servers — everything runs 100% in your browser.

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is commonly used to safely transmit binary data over channels designed for text, such as email (MIME), embedding images in HTML/CSS, and encoding data in URLs or API payloads.

Each group of 3 bytes is converted into 4 Base64 characters, resulting in an output roughly 33% larger than the original. Padding with = characters is added when the input length is not a multiple of 3.

Common Use Cases

Features

How to Use

  1. Paste text or a Base64 string into the input area
  2. Click Encode to convert text to Base64, or Decode to convert Base64 back to text
  3. Use File to Base64 to convert any file (images, PDFs, etc.) to a Base64 string
  4. Enable URL-safe mode for Base64 strings used in URLs or JWT tokens
  5. Click Copy to copy the output, or Swap to reverse the fields

Frequently Asked Questions

Is my data safe?

Yes. All encoding and decoding happens entirely in your browser using JavaScript's built-in btoa() and atob() functions. No data is sent to any server.

What is URL-safe Base64?

URL-safe Base64 replaces + with - and / with _, and removes padding = characters. This makes the encoded string safe to use in URLs, filenames, and JWT tokens without additional URL-encoding.

Can I encode files and images?

Yes. Click "File to Base64" or drag and drop any file onto the input area. The tool reads the file in your browser and converts it to a Base64 string. For images, you will also see a preview.

What is the maximum file size?

Since everything runs in your browser, the practical limit depends on your device's memory. Most modern browsers handle files up to 50-100 MB without issues. For very large files, consider a command-line tool.

Does this tool support Unicode?

Yes. The tool uses UTF-8 encoding before applying Base64, so it correctly handles all Unicode characters including emoji, CJK characters, and special symbols.

Need More Developer Tools?

Check out our full collection of free tools — JSON formatter, QR code generator, password generator, and more.

Browse All Tools
Related Tools: JSON Formatter | Text Diff Checker | Password Generator