About

Free Base64 Encoder & Decoder Online

Encode/decode text and files in standard or URL-safe Base64 with data URI support - fully client-side and private.

🟢 Runs locally · no uploads

Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 to text

lightbulbPopular Use Cases

key
API Authentication

Encode credentials for Basic Auth headers

image
Data URLs

Encode files for inline embedding in HTML/CSS

token
JWT Tokens

Decode JWT payload to inspect claims

memory
Binary Data

Encode binary data for text-based transmission

Text Input
Base64 Output
output

Encoded Base64 will appear here

code_blocksExample Inputs

Simple Text (Encode)
Hello, World!
Encoded String (Decode)
SGVsbG8sIFdvcmxkIQ==
JSON Data (Encode)
{
  "user": "john",
  "role": "admin"
}

keyboardKeyboard Shortcuts

keyboardShow shortcutsexpand_more
Ctrl+EnterProcess
Ctrl+LClear All

Related tools

Show more
Show more
› About this tool · FAQ

Stop struggling with Base64 encoding! Encode and decode Base64 data instantly for binary files, text, images, and API tokens. Supports standard and URL-safe formats with file upload and data URI generation. Perfect for embedding images, API development, and data transmission. Free, works offline, handles large files.

How do I encode Base64 online?

Paste your text or upload a file, select encoding mode, choose URL-safe option if needed, and click Encode. The tool generates Base64 output instantly with options to copy or download the result.

Is this Base64 encoder free?

Yes, completely free with unlimited encoding and decoding. No signup required, no watermarks. Handles files up to 10MB with all processing in your browser for complete privacy.

Are my files uploaded to servers?

No, all Base64 encoding and decoding happens locally in your browser. Files and text never leave your computer, ensuring complete privacy for sensitive data and images.

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data in ASCII string format by translating it into a radix-64 representation for safe transmission over text protocols.

When should I use URL-safe Base64?

Use URL-safe Base64 when the encoded string will be used in URLs or filenames. It replaces + with - and / with _, and removes padding.

Is Base64 encryption?

No, Base64 is encoding, not encryption. It's easily reversible and provides no security. Use proper encryption for sensitive data.

Why is my Base64 string longer than the original?

Base64 encoding increases size by approximately 33% because it uses more characters to represent the same data.

How do I encode text to Base64 online?

Simply paste your text into the input field and click "Encode". Our Base64 encoder supports all text formats including UTF-8, special characters, and multi-language content.

Can I decode Base64 strings with this tool?

Yes, switch to "Decode" mode to convert Base64 strings back to readable text. The tool automatically detects and handles both standard and URL-safe Base64 formats.

What's the difference between Base64 and Base64 URL-safe?

Standard Base64 uses +, /, and = characters. URL-safe Base64 replaces + with -, / with _, and removes padding (=) to safely include in URLs without encoding conflicts.

Can I encode files to Base64?

Yes, drag and drop files or use the file picker to encode any file type to Base64. Perfect for embedding images in CSS/HTML or creating data URIs for web development.

How do I create a data URI from an image?

Upload your image file and the tool will generate a complete data URI with the correct MIME type, like "data:image/png;base64,..." ready for HTML img tags or CSS backgrounds.

Is Base64 encoding secure for passwords?

No, Base64 is not secure for passwords. It's easily decoded by anyone. Use proper password hashing algorithms like bcrypt, Argon2, or PBKDF2 for password security.

Why do I see padding characters (=) in Base64?

Padding characters (=) are added to make the Base64 string length a multiple of 4. They indicate the original data length and ensure proper decoding.

Can I encode binary data to Base64?

Absolutely! Base64 is specifically designed for encoding binary data into text format. Upload any binary file and get a Base64 representation that's safe for text-based protocols.

How large files can I encode to Base64?

The tool can handle files up to 10MB efficiently. Remember that Base64 encoding increases file size by ~33%, so a 10MB file becomes ~13MB when encoded.

What are common uses for Base64 encoding?

Email attachments (MIME), embedding images in HTML/CSS, API tokens, configuration files, database blob storage, and transmitting binary data over text protocols like JSON or XML.

How do I embed a Base64 image in HTML?

Use a data URI in the img src attribute: <img src="data:image/png;base64,YOUR_BASE64_STRING_HERE">. Our tool generates complete data URIs with correct MIME types when you encode image files.

Can I encode multiple files to Base64?

Encode files one at a time for accurate results. For batch processing, encode each file separately and collect the results. This ensures correct MIME type detection and proper encoding for each file type.

Why does my decoded Base64 show garbled text?

This usually means the original data was binary (like an image or PDF) rather than text. Binary data will appear as random characters when displayed as text. Save the decoded output as a file instead of viewing it.

How do I use Base64 in CSS backgrounds?

Use the background-image property with a data URI: background-image: url("data:image/svg+xml;base64,YOUR_BASE64_STRING"). This embeds the image directly in your CSS file, eliminating an HTTP request.

What is the maximum size for Base64 encoding?

Our tool efficiently handles files up to 10MB. For larger files, encoding time increases and the 33% size overhead becomes significant. Consider using file hosting for large assets rather than Base64 embedding.

How do I decode Base64 from a JWT token?

JWT tokens have three Base64-encoded parts separated by dots. You can decode each part separately, but use our dedicated JWT Decoder tool for complete JWT parsing with header and payload extraction.

Can Base64 encoding corrupt my data?

No, Base64 is a lossless encoding that preserves all original data exactly. When properly encoded and decoded, you get back the exact same bytes. Corruption only occurs if the Base64 string is modified or truncated.

Why is my Base64 string invalid when decoding?

Common causes: URL-safe characters (- and _) in standard mode, missing or extra padding, invalid characters, or truncated data. Our decoder automatically repairs padding and detects URL-safe encoding to handle most issues.

How do I encode special characters and Unicode?

Our encoder properly handles UTF-8 text including emoji, accented characters, and non-Latin scripts. The text is first converted to UTF-8 bytes, then Base64 encoded. Decoding reverses this process exactly.