🔤

Base64 Encoder

Encode text or files to Base64, and decode Base64 back to text. Works entirely in your browser.

Plain Text 0 chars
Base64 Output 0 chars

About Our Base64 Encoder / Decoder

Base64 is an amazing piece of technology used everywhere on the internet without most people even knowing about it! Whether you're viewing an image embedded in a webpage, attaching a file to an email, or logging into an API using Basic Authentication, Base64 is behind the scenes doing the hard work!

This is a simple tool to encode text or files into your Base64 or decode Base64 strings. Everything is done inside your browser and there is no need to sign up, upload or worry about any restrictions.

How to Use the Base64 Tool?

Encoding / Decoding is very simple.

  1. First select whether you wish to encode or decode. If you want to encode text / files click Encode. If you wish to decode Base64 back to text click Decode.
  2. Select between Text and File modes. In Text mode you can simply paste any text you wish to encode. In File mode you can upload a file (Image, PDF or any other file).
  3. Paste / Type your text into the left box. If Auto-convert is turned on your output will appear instantly as you type.
  4. Click copy or download to get your result.

Why Use Our Base64 Encoder?

We have created this tool to be very simple to use with some nice features.

  • Fully Private - All your text / files are kept within your browser. No data is sent to any server. This is great if you have any sensitive text or files.
  • Unicode Friendly - Many basic Base64 tools will not work with languages such as Hindi, Arabic or Emoji. We have used the modern TextEncoder API to ensure all your unicode characters are properly handled.
  • URL Friendly - Most base64 uses '+' and '/' which are not safe to use in URLs. We have a toggle to change these to '-' and '_' to make your Base64 safe to use in URLs.
  • Encode Files - Want to add a small image directly into your HTML / CSS? Simply upload the file and we will convert it to a Base64 data URL for you to paste where ever needed.
  • Auto Detect Decode - If you are decoding Base64 we will automatically detect if it is URL friendly.

How Does Base64 Work?

Base64 takes a group of 3 bytes (24 bits) of binary data and converts it into 4 printable ASCII characters. This uses 64 different printable characters (A-Z, a-z, 0-9, +, /). If the text is not a multiple of 3 then 1 or 2 '=' will be added to the end.

This produces text only data which can easily be passed along channels that only accept printable characters (Email, HTML, JSON, XML, URLs and more). However the size will increase by around 33%.

Where is Base64 Used?

As soon as you start looking you will see Base64 being used in many places.

  • Include small images in HTML / CSS / JSON using Data URLs.
  • Email attachments using MIME.
  • HTTP Basic Auth header (Username:Password).
  • JSON Web Tokens (JWT).
  • API keys or certificates in environment variables / config files.
  • Binary data in XML.
  • Cryptographic Keys in PEM files.

FAQs

What is Base64 Encoding?

A way to encode binary data using 64 printable characters (A-Z, a-z, 0-9, +, /). Usually used to include images or files in text based files (HTML, CSS, JSON, Email etc).

Is Base64 Encryption?

No! Base64 is an encoding method. Anyone can easily decode Base64 to get the original data. If you need to protect any sensitive data use a proper encryption method (such as AES).

Why is Base64 Larger?

Every 3 bytes of binary data is converted to 4 characters. This will increase the size by around 33%.

Is My Data Safe?

Yes! All encoding / decoding is done using JavaScript in your browser. No data is uploaded to any server. Your text / files will not be stored or shared. You can even unplug your internet connection and it will still work!

What is URL Friendly Base64?

Most Base64 uses '+' and '/'. These have some special meaning in URLs. Using URL Friendly Base64 will change these to '-' and '_' to make sure your Base64 can be used directly in URLs.

Can I use Unicode Characters (Hindi / Emoji)?

Yes! We use the TextEncoder API to convert your text to UTF-8 bytes and then encode them. This means Hindi, Chinese, Arabic, Emojis & any other Unicode characters will work perfectly.

Is There a File Size Limit?

We recommend keeping files under 10MB to ensure smooth performance in your browser. Larger files will still work however they may cause your browser to lag or run out of memory as everything is processed on your device.

Where is Base64 Commonly Used?

In many places! Data URLs to include images in HTML / CSS. Email attachments using MIME. API Authentication Tokens (Basic Auth). JSON Web Tokens (JWT) and Config files to store binary data as text.

Other Tools You May Find Useful

If you found this Base64 tool useful you may also enjoy our JSON Formatter, URL Encoder and Image Compressor.