🔑 Developer Tool

Base64 Encoder / Decoder

Encode & decode text, URLs and images to/from Base64. URL-safe encoding, file support — all browser-based.

Input: 0 chars
Output: 0 chars
Size Ratio:
Valid Base64:
Input bytes: 0
📥 Input
READY
0
📤 Output
WAITING
0
What is Base64?
Encodes binary data into 64 ASCII characters (A-Z, a-z, 0-9, +, /)
Output is ~33% larger than input
Common Uses
JWT tokens & API auth headers
Email attachments (MIME)
Data URIs in HTML/CSS
Tips
Use Auto Detect to encode or decode automatically
Swap panels to reverse the operation
📖 Guide

How to Use the Base64 Encoder & Decoder

KJSynthora's Base64 tool supports three modes — text encoding, image conversion, and URL encoding — all running entirely in your browser with zero server uploads.

STEP 01
Select a Mode
Choose Text, Image to Base64, or URL Encode/Decode using the tabs at the top.
STEP 02
Enter Your Input
Type or paste text, drop an image file, or enter a URL depending on the selected mode.
STEP 03
Encode or Decode
Click Encode to convert to Base64, or Decode to reverse. Use Auto Detect to let the tool decide.
STEP 04
Copy or Download
Copy the result to clipboard or download it as a .txt file for later use.
📚 Learn

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts binary data into a sequence of printable ASCII characters. It uses a 64-character alphabet consisting of uppercase letters (A–Z), lowercase letters (a–z), digits (0–9), and the symbols + and /, with = as padding.

How Base64 Works

Base64 groups the input into 3-byte blocks (24 bits), then splits each block into four 6-bit groups. Each 6-bit group maps to one of the 64 characters in the alphabet. This means every 3 bytes of input produces 4 characters of output, resulting in a size increase of approximately 33%.

Input: "KJ" → Binary: 01001011 01001010 Groups: 010010 | 110100 | 1010XX (padded) Output: "S0o=" (Base64 encoded)

Common Use Cases for Base64

🔐
JWT Tokens
JWT header and payload are Base64Url encoded for safe URL transmission.
📧
Email Attachments
MIME protocol uses Base64 to encode binary attachments in plain-text email.
🖼️
Inline Images
Embed images directly in HTML or CSS using data: URLs without separate requests.
🔌
API Payloads
Encode binary data like files or credentials in JSON API request bodies.
🌐
HTTP Basic Auth
Basic authentication encodes username:password as Base64 in the Authorization header.
📦
Data Storage
Store binary blobs as text in databases or configuration files that only accept ASCII.
⚖️ Comparison

Base64 vs URL Encoding vs Hex

Three common encoding schemes are used in web development — here is how they compare:

Encoding Input Output Size Change Use Case
Base64 Any binary A-Z, a-z, 0-9, +/= +33% JWT, emails, data URIs
URL Encoding URLs / text %XX percent codes Varies Query strings, form data
Hex (Base16) Any binary 0-9, A-F +100% Hashes, cryptography, debugging
Base64Url Any binary A-Z, a-z, 0-9, -_ +33% JWT, OAuth, URL-safe tokens
❓ FAQ

Frequently Asked Questions

Base64 is a binary-to-text encoding that converts any binary data into 64 printable ASCII characters. Use it when you need to transmit binary data (like images or files) over text-based protocols such as email, JSON APIs, or HTML data URIs. It is also essential for JWT tokens and HTTP Basic authentication.

Paste your text into the Input field on this page and click the Encode button. The Base64-encoded result appears instantly in the Output panel. You can then copy it to clipboard or download it as a file. No signup or account is needed — it is completely free.

Paste your Base64 string into the Input field and click the Decode button. The tool validates the format and shows the decoded text. If the string is not valid Base64, an error is displayed. You can also use Auto Detect to automatically determine whether to encode or decode.

Yes. Click the Image to Base64 tab, then drag and drop or upload any JPG, PNG, WEBP, GIF, or SVG image. The tool instantly generates the Base64 string, the full data URL, a ready-to-use HTML img tag, and a CSS background-image snippet. You can copy any of these formats directly.

Base64 encodes every 3 bytes of binary input as 4 ASCII characters. This 4/3 ratio means the output is approximately 33% larger than the original. For example, a 100 KB image becomes roughly 133 KB when Base64 encoded. This is a known trade-off for safe text-based transmission.

Standard Base64 uses + and / characters which are not URL-safe. Base64Url replaces + with - and / with _, and removes padding = characters. Base64Url is used in JWT tokens, OAuth flows, and any context where the encoded string appears in a URL or filename.

Yes. All encoding and decoding happens entirely inside your browser using JavaScript. No data is sent to any server, and nothing is stored or logged anywhere. Your input stays completely private on your device.

URL encoding (percent encoding) replaces special characters in URLs with a % followed by a two-digit hexadecimal code. For example, a space becomes %20. It is used specifically for URLs and query strings, not for general binary data transmission. Base64 is for encoding any binary data as text, while URL encoding is for making URLs safe.

🔗 Related

Related Developer Tools