Base64 Encoder & Decoder - Free Online
Encode text to Base64 or decode Base64 back to text instantly. Full Unicode support. Free, private, browser-based.
Enter text above or upload a file to get started
What is Base64 encoding?
Base64 is a way to represent binary data as ASCII text. It's commonly used in data URLs, email attachments, API tokens, and embedding images in CSS/HTML. This tool encodes and decodes Base64 with full Unicode support.
Base64 encoding works by taking groups of 3 bytes (24 bits) and splitting them into 4 groups of 6 bits. Each 6-bit group maps to one of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). If the input length is not a multiple of 3, the output is padded with '=' characters. This encoding increases data size by approximately 33%.
Developers use Base64 encoding to embed small images as data URIs in HTML/CSS (avoiding extra HTTP requests), encode binary attachments in email (MIME encoding), pass binary data through JSON APIs that only support text, create HTTP Basic Authentication headers, and encode JWT token segments. It is also used in configuration files that need to store binary data.
Only use Base64 for data under 10 KB when embedding in HTML or CSS - larger Base64 strings bloat the document and cannot be cached separately by browsers. Remember that Base64 is encoding, not encryption - anyone can decode it instantly. For actual security, use encryption tools like AES. When working with URLs, use Base64url variant (replacing + with - and / with _) to avoid URL-encoding issues.
Browser developer consoles offer btoa() and atob() functions for Base64, but they only handle ASCII text. Command-line tools like base64 on Linux/Mac work with files but lack a visual interface. This tool handles full Unicode text and provides instant encode/decode with a clean interface - useful for quick debugging without remembering function names or terminal syntax.
How the Base64 Encoder Works
- 01Paste or type your text in the input field
- 02Choose Encode to convert text to Base64, or Decode to convert Base64 back to text
- 03The result appears instantly
- 04Copy the output to your clipboard
What Base64 Encoding Is Used For
Base64 encoding converts binary data into ASCII text, making it safe to transmit through systems that only handle text. Common uses include embedding small images directly in HTML or CSS (data URIs), encoding email attachments (MIME), and passing binary data in JSON APIs. Note that Base64 is not encryption - it's easily reversible and provides no security.
When to Use Base64 Encoding
Use Base64 encoding to embed binary data (images, files) in text-based formats like HTML, CSS, JSON, or email. Common use cases include embedding small images directly in HTML or CSS (data URIs), encoding file attachments in email (MIME), sending binary data through REST APIs, and encoding authentication credentials for HTTP Basic Auth headers.
Common Use Cases
- Embed small images as data URIs in HTML or CSS to save HTTP requests → Compress Images Online
- Encode file attachments for email transmission (MIME encoding)
- Create HTTP Basic Authentication headers by encoding username:password → Hash Generator
- Decode Base64-encoded JWT token segments for debugging → URL Encoder & Decoder
- Pass binary data through JSON APIs that only support text values
Expert Tips
- Only embed images as Base64 data URIs if they are under 10 KB - larger Base64 strings bloat your HTML and cannot be cached separately by browsers
- Base64 is encoding, not encryption - anyone can decode it instantly, so never use it to protect sensitive data
- When using Base64 in URLs, use the Base64url variant (replacing + with - and / with _) to avoid conflicts with URL special characters
Frequently Asked Questions
What is Base64 encoding?→
Is Base64 encryption?→
When should I embed images as Base64?→
Is this encoder free and private?→
Related tools
12 suggested- 01URL Encoder & Decoder - Free Online ToolEncode or decode URLs and special characters for web use. Instant results, browser-based. Essential tool for web developers.
- 02HTML Entity Encoder & Decoder - FreeEncode special characters to HTML entities or decode entities back to text. Common entities reference included. Free online tool.
- 03Text to Binary Converter - Hex & Octal TooConvert text to binary, hexadecimal, and octal and back. Includes ASCII table reference. Free online converter tool.
- 04JWT Decoder - Inspect Tokens InstantlyDecode and inspect JSON Web Tokens instantly. View header, payload, and expiration. Free, private. Your tokens stay in your browser.
- 05Cron Expression Parser - Human-ReadableParse and explain cron expressions in plain English. See next run times and validate your schedule. Free online cron debugger.
- 06UUID & ULID Generator - Bulk & SecureGenerate UUIDs (v4) and ULIDs in bulk. Cryptographically secure, browser-based. Generate up to 50 IDs at once. Free online tool.
- 07Unix Timestamp Converter - Date & TimeConvert between Unix timestamps and human-readable dates instantly. Supports seconds and milliseconds. Free developer tool.
- 08Diff Checker - Compare Text Side by SideCompare two texts and see differences highlighted line by line. Color-coded additions and deletions. Free, private, no upload needed.
- 09YAML ↔ JSON Converter - Instant & FreeConvert between YAML and JSON formats instantly. Bidirectional conversion with syntax validation. Free online developer tool.
- 10XML Formatter - Prettify & Validate FreeFormat and prettify XML with proper indentation and syntax validation. Customizable indent size. Free online XML beautifier.
- 11SQL Formatter - Beautify Queries OnlineFormat SQL queries with proper indentation and keyword highlighting. Supports all major SQL dialects. Free online SQL beautifier.
- 12Chmod Calculator - Unix File PermissionsCalculate Unix file permissions visually. Convert between symbolic and numeric (octal) notation. Free tool for developers and sysadmins.
Link to this tool
Free to use, free to linkMentioning this tool in a README, a blog post or your team wiki? Paste one of these and your readers land straight on the tool, running in their own browser.
- HTML
<a href="https://toolforte.com/tools/base64-encoder">Base64 Encoder & Decoder</a> - MD
[Base64 Encoder & Decoder](https://toolforte.com/tools/base64-encoder)