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 - No Upload Required
- Encode file attachments for email transmission (MIME encoding)
- Create HTTP Basic Authentication headers by encoding username:password Hash Generator - SHA-256, SHA-512 & More
- Decode Base64-encoded JWT token segments for debugging URL Encoder & Decoder - Free Online Tool
- 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
- Base64 is a binary-to-text encoding scheme that converts binary data into a string of ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, /) plus = for padding. The encoded output is about 33% larger than the original data, but it can safely travel through systems that only support text.
- No, Base64 is encoding, not encryption. It does not provide any security - anyone can decode Base64 instantly. For security, use proper encryption algorithms like AES or RSA.
- Embed small images (under 10KB) as Base64 data URIs to save HTTP requests. For larger images, use regular file URLs - Base64 increases file size by 33% and cannot be cached separately by the browser.
- Yes, completely free. All encoding and decoding happens in your browser - no data is sent to any server.
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.
- 04JSON Formatter & Validator - Instant ResultsFormat, validate, and minify JSON with instant error highlighting. Pinpoints syntax errors. Free, private, browser-based.
- 05JSON to CSV Converter - Export InstantlyConvert JSON arrays to CSV format with automatic header detection. Download as CSV file. Free, browser-based - no upload needed.
- 06CSV to JSON Converter - Auto-Detect FormatConvert CSV data to JSON format instantly. Auto-detects delimiters and headers. Free, private, browser-based - no upload needed.
- 07JSON to XML Converter - Instant & FreeConvert JSON data to XML format with proper indentation and escaping. Free, browser-based converter - no upload needed.
- 08JSON Tree Viewer - Expandable VisualizerVisualize JSON data as an expandable, collapsible tree. Search keys and values, copy JSON paths. Free online JSON explorer.
- 09JSON Schema Validator - Free Online ToolValidate JSON data against a JSON Schema instantly. Perfect for AI function calling and API validation. Free, browser-based.
- 10Regex Tester - Live Matching & HighlightingTest regular expressions with live matching and highlighting. Supports all flags and capture groups. Free online regex debugger.
- 11JWT Decoder - Inspect Tokens InstantlyDecode and inspect JSON Web Tokens instantly. View header, payload, and expiration. Free, private - your tokens stay in your browser.
- 12Cron Expression Parser - Human-ReadableParse and explain cron expressions in plain English. See next run times and validate your schedule. Free online cron debugger.
From the blog
Further reading- Base64, URL Encoding & HTML Entities ExplainedEncode and decode Base64, URLs, and HTML entities instantly. Learn when to use each format, with examples and free converter tools.8 min read
- 15 Free Developer Tools Every Programmer Should BookmarkEssential free developer tools for formatting JSON, encoding Base64, generating UUIDs, parsing regex, converting timestamps, and more. All browser-based, no installation needed.11 min read
- Understanding Hashing, Encryption, and Encoding: What's the Difference?A clear, practical explanation of hashing, encryption, and encoding - three concepts developers and security-conscious users frequently confuse. Learn what each does, when to use which, and the security implications of choosing wrong.9 min read
Base64 Encode/Decode
Encode and decode Base64 strings instantly from your browser toolbar. No need to visit a website for quick conversions.
Install Free Extension→