Base64 Encode / Decode

Encode text to Base64 or decode Base64 back to text. Also converts images to Base64 data URLs. Bidirectional and real-time.

What is Base64 Encode / Decode?

Base64 is a binary-to-text encoding scheme defined in RFC 4648 that represents arbitrary byte sequences using 64 printable ASCII characters — the letters A–Z and a–z, the digits 0–9, plus + and /, with = for padding. Each group of three input bytes (24 bits) becomes four output characters (6 bits each), so encoded output is roughly 33% larger than the original. Base64 is widely used to embed binary data into text-only contexts: data URIs in HTML and CSS, attachments in MIME email, JWT segments, basic HTTP authentication headers, and JSON payloads carrying images or files. A URL-safe variant substitutes - and _ for + and /.

How to use

  1. For text: type or paste into the left box and the Base64 output appears on the right (or vice versa).
  2. For images: switch to the Image tab, click "Choose file", and the Base64 data URL is generated instantly.
  3. Click "Copy Base64" to copy the encoded output to your clipboard.

Frequently asked questions

What is Base64 encoding?

Base64 is an encoding scheme that converts binary data into ASCII text. It uses 64 printable characters (A-Z, a-z, 0-9, +, /) and is commonly used to embed binary data in text-based formats like JSON, XML, and email.

Does Base64 encrypt my data?

No. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 without a key. Do not use it to protect sensitive data.

Why does Base64 output have = padding?

Base64 works in 6-bit groups. When the input length is not divisible by 3, padding characters (=) are added to make the output a multiple of 4 characters.

Can I use a Base64 image in HTML?

Yes. You can use a Base64 data URL directly in an src attribute: . This embeds the image inline without a separate file request.

Last updated

Powered by maratool