Encoding Tool

Base64 Encoder / Decoder

Encode or decode Base64 strings instantly. Supports standard, URL-safe, file encoding, image preview, JWT decoding and more 100% private, runs in your browser.

Mode
Variant
Output Wrap
Quick Load Samples
Plain Text
0chars
0 Bsize
Base64 Output
Your encoded Base64 will appear here…
🔒
100% Private

All encoding and decoding runs entirely in your browser. No data is ever sent to any server.

Instant Results

Output updates in real-time as you type. No button clicks needed for live encoding.

📎
File Encoding

Upload any file up to 5MB and get its Base64 representation instantly for data URIs.

What Is Base64 Encoding? A Complete Guide

Base64 is a method for representing binary data using only 64 printable ASCII characters: the uppercase letters A to Z, the lowercase letters a to z, the digits 0 to 9, and two extra symbols (+ and / in standard Base64). It was created so that binary data, such as images, files or raw bytes, can be safely transmitted through systems that were designed to handle text only, like email, JSON, XML and URLs. Without an encoding like Base64, raw binary bytes can be corrupted or misinterpreted when they pass through text-based channels.

The name comes from the fact that the scheme uses a base of 64 values. Base64 works by taking three bytes of input (24 bits) and splitting them into four groups of six bits each. Because six bits can represent 64 different values (2 to the power of 6), each group maps neatly to one of the 64 characters in the Base64 alphabet. When the input length is not a multiple of three, the output is padded with one or two equals signs (=) so the result is always a multiple of four characters long.

A side effect of this three-to-four expansion is that Base64-encoded data is roughly 33% larger than the original. This is the trade-off you accept in exchange for being able to move binary data safely through text-only systems. The TOOLBeans encoder shows you this size change live, so you can see exactly how much larger your encoded output is than the original input.

How to Encode and Decode Base64 Step by Step

1
Choose Encode or Decode

Use the Mode toggle to pick Encode (turn plain text into Base64) or Decode (turn a Base64 string back into readable text). The tool processes your input live as you type, so there is no separate button to press.

2
Pick standard or URL-safe

Select the Variant. Standard Base64 (RFC 4648) uses + and / and is right for most cases. URL-safe Base64 replaces those with - and _ and drops padding, which is what JWT tokens, URLs and filenames require.

3
Type, paste or upload

Type directly, click Paste to pull from your clipboard, or click File to upload any file up to 5MB. For image files the tool shows a live preview and lets you copy the full data URI for use in CSS or HTML.

4
Read and search the output

The result appears instantly with character count, byte size and the percentage size change. For long outputs you can search within the result, toggle line wrapping, copy to clipboard, or download it as a text file.

5
Swap to reverse the operation

Click Swap to move the output into the input box and flip the mode, so you can immediately verify that decoding your encoded value returns the original, or vice versa.

6
Decode JWT tokens

Load the JWT sample or paste a token to decode its Base64URL header and payload into readable JSON. For full claim inspection and expiry checks, use the dedicated JWT Decoder tool.

What Is Base64 Used For?

🖼️
Inline Images (Data URIs)
Embed images directly in HTML or CSS as data URIs so the browser does not need a separate HTTP request. Useful for small icons and email templates. Upload an image here to get its data URI instantly.
🔑
JWT Tokens
JSON Web Tokens, used for authentication across most modern web apps, encode their header and payload sections as URL-safe Base64. Decoding them lets you inspect the claims inside.
📧
Email Attachments (MIME)
The MIME email standard uses Base64 to encode binary attachments such as PDFs and images into plain text so they survive transmission through mail servers.
🔐
HTTP Basic Authentication
Basic Auth combines a username and password as "username:password" and Base64-encodes the result into the Authorization header. Note this is encoding, not encryption.
💾
Binary Data in JSON / XML
APIs that exchange JSON or XML cannot hold raw binary, so files and byte arrays are Base64-encoded into string fields and decoded on the other side.
🔗
URL-Safe Identifiers
Base64URL is used for tokens, share links, and filenames where + and / would otherwise break the URL or path. It swaps them for - and _ and removes padding.

Standard vs URL-Safe Base64: What Is the Difference?

Both variants encode the same data, but they use a slightly different alphabet for two characters. The difference matters because the standard + and / characters have special meaning inside URLs and file paths, where they would need extra escaping. URL-safe Base64 avoids that problem entirely.

Standard Base64
Spec: RFC 4648 §4
Characters: A–Z, a–z, 0–9, + , / , =
Best for: General encoding, email (MIME), data URIs, binary in JSON
URL-Safe Base64
Spec: RFC 4648 §5
Characters: A–Z, a–z, 0–9, - , _ (no padding)
Best for: JWT tokens, URLs, query strings, filenames, cookies

⚠️ Important: Base64 Is Not Encryption

This is the single most common misconception about Base64, and getting it wrong can cause real security problems. Base64 is an encoding scheme, not an encryption scheme. There is no secret key involved. Anyone who sees a Base64 string can decode it back to the original in seconds, exactly as this free tool does. It provides zero confidentiality.

Never use Base64 to protect passwords, API secrets, personal data or anything sensitive. If you need to keep data secret, you need real encryption such as AES, and you must keep the key private. Base64 simply changes the representation of data so it can travel safely through text channels it does not hide the data's contents from anyone.

Frequently Asked Questions

Is this Base64 encoder and decoder free?+
Yes. It is completely free with no usage limits, no account and no signup. Every feature, including file encoding, image preview, URL-safe mode, JWT decoding, output search and download, is available to everyone.
Does my data get uploaded to a server?+
No. All encoding and decoding runs entirely in your browser using JavaScript. Your text and files never leave your device and are never sent to any server, which makes the tool safe for sensitive data.
What is the difference between standard and URL-safe Base64?+
Standard Base64 uses + and / characters, which have special meaning in URLs and file paths. URL-safe Base64 replaces + with - and / with _ and removes padding, so the encoded string can be used directly in URLs, query strings and filenames. JWT tokens use URL-safe Base64.
Can I encode an image or file to Base64?+
Yes. Click the File button and upload any file up to 5MB. The tool encodes it to Base64 instantly. For images it also shows a live preview and lets you copy the full data URI, which you can paste straight into CSS or an HTML img src.
Is Base64 the same as encryption?+
No. Base64 is encoding, not encryption. It is fully reversible with no secret key, so anyone can decode a Base64 string instantly. Never use Base64 to protect passwords or sensitive data; use real encryption like AES for that.
Why is my Base64 output longer than the input?+
Base64 represents every 3 bytes of input as 4 characters of output, which makes the encoded result about 33% larger than the original. This size increase is the cost of being able to send binary data safely through text-only systems. The tool shows the exact size change for every conversion.
Can I decode a JWT token here?+
Yes. Paste a JWT or load the JWT sample, and the tool decodes the Base64URL header and payload into readable JSON. For full claim inspection, signature details and an expiry countdown, use the dedicated JWT Decoder tool.
What does the padding character "=" mean?+
The equals sign is padding. Because Base64 output must be a multiple of four characters, one or two = characters are added at the end when the input length is not a multiple of three. URL-safe Base64 usually omits padding entirely.
Does it support Unicode and emoji?+
Yes. The tool encodes text as UTF-8 before converting to Base64, so accented characters, non-Latin scripts and emoji are all handled correctly and decode back exactly as entered.
Can I search inside a long encoded result?+
Yes. When the output is long, a search box appears above it that filters the displayed lines to those containing your search text, which is handy for finding a specific segment inside a large encoded blob.