Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 strings instantly. Two-way real-time conversion with full UTF-8 support.
What is Base64 Encoding?
Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It was designed to safely transmit binary data over channels that only support text — such as email (MIME), HTTP headers, and JSON payloads. Encoding increases data size by roughly 33% but guarantees the output is safe for any text-based protocol. The URL-safe variant replaces + and / with - and _ for use in URLs and filenames.
Common Use Cases
- Embed images, fonts, or binary assets directly in HTML, CSS, or JSON as data URIs
- Encode credentials for HTTP Basic Authentication headers
- Transmit binary data through APIs that only accept text payloads
- Store binary blobs (images, certificates) in databases or config files
- Decode Base64-encoded email attachments or MIME parts
How It Works
Base64 works by grouping the input bytes into 6-bit chunks (since 2⁶ = 64) and mapping each chunk to one of 64 characters. Every 3 bytes of input produce exactly 4 Base64 characters. If the input length is not a multiple of 3, padding characters (=) are appended. This tool uses the browser's built-in btoa() and atob() functions for plain text and handles UTF-8 strings correctly.
Frequently Asked Questions
Is Base64 a form of encryption?
No. Base64 is encoding, not encryption. It is trivially reversible by anyone with the encoded string. Never use Base64 to protect sensitive data — use proper encryption algorithms like AES-256 instead.
What is the difference between standard and URL-safe Base64?
Standard Base64 uses + and /, which have special meanings in URLs. URL-safe Base64 replaces them with - and _, making the output safe to embed in URLs and filenames without percent-encoding.
Why does my Base64 string end with == ?
Padding characters (=) are added to make the encoded length a multiple of 4. One or two padding characters appear when the input byte count is not divisible by 3.
Related Tools
JWT Decoder
Decode and inspect JSON Web Tokens securely in your browser.
JSON Formatter
Format, validate, and minify JSON data instantly with syntax highlighting.
Unix Timestamp
Convert Unix timestamps to human-readable dates and back instantly.
URL Encoder
Encode and decode URLs with percent-encoding instantly.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes instantly.
JSON ↔ YAML
Convert between JSON and YAML instantly with real-time validation.
Regex Tester
Test and debug regular expressions with live match highlighting.
UUID Generator
Generate UUID v4 values instantly, with bulk generation and validation.
JWT Generator
Build and sign JSON Web Tokens with a custom payload and secret.
Text Diff
Compare two blocks of text and highlight additions, deletions, and unchanged lines.
Case Converter
Convert text to camelCase, snake_case, UPPERCASE, kebab-case, and more.
Cron Parser
Parse cron expressions into plain English and see the next scheduled run times.
SQL Formatter
Format and minify SQL queries with dialect support for MySQL, PostgreSQL, SQLite, and more.
CSV ↔ JSON
Convert CSV to JSON or JSON to CSV with support for custom delimiters and quoted fields.
Number Base Converter
Convert between decimal, hexadecimal, octal, and binary number bases.
Color Converter
Convert colours between HEX, RGB, HSL, HSV, and CMYK formats.
What is Base64? Base64 is a group of binary-to-text encoding schemes that represent binary data in an ASCII string format.
It is commonly used to encode data that needs to be stored and transferred over media that are designed to deal with text.