Base64 Encoder & Decoder

Convert text and binary data to Base64 format and back with full UTF-8 support
the standard encoding for data transmission in APIs and email

πŸ” Base64 Encoding Made Simple

Base64 is the standard encoding scheme for transmitting binary data over text-based protocols. Used extensively in email attachments, data URIs, API responses and web development. Our tool provides instant, accurate Base64 encoding and decoding with full UTF-8 character support.

βœ“ Encode images for data URIs
βœ“ Email attachment encoding (MIME)
βœ“ API request/response handling
βœ“ Store binary data in JSON/XML
βœ“ Authentication tokens (JWT)
βœ“ Database text storage

πŸ”’ Base64 Encoder

πŸ”“ Base64 Decoder

πŸ§ͺ Example Base64 Operations

Click an example to see Base64 encoding in action

Simple Text
Hello, World!
Basic encoding
JSON Data
{"name":"John","age":30}
API data
Unicode Text
γ“γ‚“γ«γ‘γ―δΈ–η•Œ 🌍
UTF-8 support
JWT Token
eyJhbGciOiJIUzI1NiJ9...
Decode JWT payload

πŸ“š Understanding Base64 Encoding

Base64 is a binary-to-text encoding scheme that converts binary data into ASCII text format using 64 characters (A-Z, a-z, 0-9, +, /). It's essential for transmitting binary data over text-based protocols that only support ASCII.

How Base64 Works:

  • Character Set - Uses 64 characters: A-Z (26), a-z (26), 0-9 (10), + and / (2)
  • Encoding Process - Every 3 bytes (24 bits) of input are split into four 6-bit groups, each encoded as one Base64 character
  • Padding - Uses '=' character to pad output when input isn't divisible by 3
  • Size Increase - Output is approximately 33% larger than input (4 characters for every 3 bytes)
  • UTF-8 Support - Our tool handles Unicode text correctly by first encoding to UTF-8

Common Use Cases:

  • Email Attachments (MIME) - Standard encoding for email attachments in SMTP protocol
  • Data URIs - Embed images directly in HTML/CSS using data:image/png;base64,...
  • JSON/XML Storage - Store binary data in text-based formats
  • Basic HTTP Authentication - Username:password encoded as Base64 in Authorization header
  • JWT Tokens - JSON Web Tokens use Base64URL encoding for header and payload
  • API Communication - Transmit files and binary data via REST APIs
  • Database Storage - Store binary blobs in text columns

Base64 vs Base64URL:

  • Base64 - Uses + and / characters, requires = padding. Used in MIME, email.
  • Base64URL - Uses - and _ instead of + and /, no padding. URL-safe, used in JWT tokens.
  • When to use - Use Base64 for general encoding. Use Base64URL for URLs and filenames.

Best Practices:

  • Don't use Base64 for security - it's encoding, not encryption
  • Remove whitespace and line breaks before decoding
  • Use Base64URL for URLs to avoid special character issues
  • Consider compression before encoding large data
  • For images in HTML, use data URIs sparingly (impacts page load)
  • Remember the 33% size overhead when planning storage

⚠️ Privacy Note: All encoding and decoding happens locally in your browser. No data is transmitted to servers.

❓ Frequently Asked Questions

Base64 is a binary-to-text encoding scheme that converts binary data into ASCII text format using 64 characters (A-Z, a-z, 0-9, +, /). It's used to safely transmit binary data over text-based protocols like email, HTTP and JSON. Every 3 bytes of input are encoded into 4 Base64 characters, increasing data size by approximately 33%.

Use Base64 encoding for: embedding images in HTML/CSS (data URIs), email attachments (MIME encoding), storing binary data in JSON/XML, Basic HTTP Authentication, JWT tokens, transmitting files via APIs, encoding binary data for databases that only support text and including binary assets in configuration files.

JWT tokens have three Base64-encoded parts separated by dots: header.payload.signature. To decode: 1) Split the JWT by dots, 2) Take the middle part (payload), 3) Use our Base64 decoder to decode it. The result is a JSON object containing your token's claims and data. Note: Decoding a JWT does not verify its signature.

Base64 encoding increases size by ~33% because it represents 3 bytes (24 bits) of binary data using 4 Base64 characters (24 bits in 6-bit chunks). This overhead is the cost of converting binary data to text-safe format. For example, a 100KB image becomes ~133KB when Base64 encoded.

This tool is designed for text encoding. For image files, you'll need to first read the file as binary data. In modern browsers, you can use FileReader API to read files as data URLs (which are Base64 encoded). Our tool works best for encoding text strings, JSON data and decoding existing Base64 strings.

Absolutely! All Base64 encoding and decoding happens locally in your browser using JavaScript. No data is ever transmitted to our servers or any third party. You can use this tool completely offline. Your data never leaves your device.