How to Encode and Decode Base64 Online

Base64 encoding comes up everywhere — embedding images in CSS, handling API authentication, reading email attachments. Here's how to encode and decode it instantly.

Open Base64 Encoder / Decoder 100% free. No sign-up. Works in your browser.

Quick Answer

Paste any text or Base64 string into the free tool at dotsapps.com to encode or decode it instantly. Everything runs in your browser — your data never leaves your device.

What Is Base64 Encoding Used For

Base64 converts binary data into plain ASCII text. This matters because many systems — email, JSON, URLs, HTML — only handle text safely. Binary data can break these systems.

Common uses include:

  • Embedding images in HTML/CSS — Convert a small image to a Base64 data URI to avoid an extra HTTP request.
  • API authentication — HTTP Basic Auth encodes your username:password in Base64.
  • Data transfer — Sending binary data (files, images, PDFs) through text-only channels like JSON APIs.
  • Email attachments — MIME encoding uses Base64 to attach files to emails.

Base64 is not encryption. Anyone can decode it. It's purely a format conversion, not a security measure.

How to Encode Text to Base64

Encoding converts readable text into a Base64 string. For example, "Hello, World!" becomes "SGVsbG8sIFdvcmxkIQ==".

Open the Base64 tool at dotsapps.com. Make sure you're in Encode mode. Type or paste your text. The Base64 output appears instantly.

The encoded string is always longer than the original — roughly 33% larger. That's because Base64 uses only 64 safe ASCII characters to represent all possible byte values. The tradeoff is size for compatibility.

The = signs at the end are padding. They appear when the input length isn't divisible by 3. They're part of the standard and should not be removed.

How to Decode Base64 to Plain Text

Decoding reverses the process. You have a Base64 string and want to see the original content.

This is useful when you encounter Base64 in the wild. JWT tokens contain Base64-encoded JSON. API error messages sometimes return Base64 data. Config files may store credentials in Base64 (which is not secure, but common).

Switch to Decode mode in the tool. Paste the Base64 string. The original text appears immediately. If the decoded output looks like garbage characters, the original data was likely binary (an image or file), not text.

Base64 Encoding in Different Programming Languages

Once you've tested your encoding/decoding in the online tool, here's how to do it in code:

JavaScript: btoa('Hello') to encode, atob('SGVsbG8=') to decode. For Unicode text, use btoa(unescape(encodeURIComponent(text))).

Python: import base64; base64.b64encode(b'Hello') to encode, base64.b64decode('SGVsbG8=') to decode.

Command line: echo -n 'Hello' | base64 to encode, echo 'SGVsbG8=' | base64 -d to decode.

The online tool is perfect for quick checks and for verifying that your code produces the correct output.

How to Do It: Step-by-Step

  1. 1

    Open the Base64 Encode/Decode tool at dotsapps.com

  2. 2

    Choose Encode or Decode mode

  3. 3

    Paste your text or Base64 string into the input area

  4. 4

    The result appears instantly in the output area

  5. 5

    Click Copy to grab the result

Try Base64 Encoder / Decoder Now →

Frequently Asked Questions

Is Base64 encoding the same as encryption?

No. Base64 is a format conversion, not encryption. Anyone can decode Base64 without a key or password. Never use Base64 to protect sensitive data — use actual encryption like AES-256 instead.

Why is my Base64 string longer than the original?

Base64 encoding increases data size by about 33%. It uses only 64 ASCII characters to represent all possible byte values, so it needs more characters to store the same amount of data.

What do the equals signs at the end of Base64 mean?

The = signs are padding characters. Base64 processes data in chunks of 3 bytes. If the input isn't evenly divisible by 3, padding is added to complete the final chunk. One = means 1 byte of padding, == means 2 bytes.

Can I Base64 encode an image?

Yes. Images encoded as Base64 can be embedded directly in HTML or CSS using data URIs. This eliminates an HTTP request but increases the HTML file size by about 33%. It's best for small images like icons.

Why does Base64 decoding show weird characters?

If the decoded output shows strange characters, the original data was probably binary (like an image or compressed file), not readable text. Base64 can encode any binary data, not just text.

Ready to Try It?

Base64 Encoder / Decoder is free, private, and works right in your browser. No sign-up needed.

Open Base64 Encoder / Decoder

Related Tools You Might Like

Cloud Sync

Connected to Google Drive