Base64 Encode & Decode
Encode text to Base64 or decode Base64 strings back to plain text. Supports standard Base64, URL-safe Base64url, MIME wrapping, and UTF-8 characters.
Reviewed May 25, 2026. Privacy model: tool input is processed in your browser and is not uploaded to BytePane servers.
Input bytes
0
Output bytes
0
Mode
RFC 4648
Encode overhead
-
Basic Auth Header Helper
Generate the HTTP Basic Authorization header format used by curl, REST clients, and legacy APIs. This runs locally in your browser.
Authorization: Basic <base64(username:password)>Basic Auth is only encoding, not encryption. Send it only over HTTPS and avoid storing real secrets in browser history or shared screenshots.
About Base64 Encoding
Base64 is a group of binary-to-text encoding schemes that represent binary data using 64 ASCII characters. It is commonly used in web development to embed images in CSS, encode API authentication tokens, handle email attachments, and transfer binary data over text-based protocols.
This tool encodes and decodes Base64 entirely in your browser using the built-in btoa() and atob() functions with UTF-8 support. No data is sent to any server. Use Standard mode for normal RFC 4648 Base64, URL-safe mode for JWT/OAuth/URL parameters, and MIME mode when you need 76-character line wrapping for email-style payloads.
Base64 Key Facts
33%
Size overhead — Base64 output is always ~33% larger than the original binary data
64
Characters used: A-Z, a-z, 0-9, + and / (with = for padding)
RFC 4648
The standard that defines Base64 encoding (published 2006, still current)
Where Base64 Is Used
Data URIs in HTML/CSS use Base64 to embed small images directly in code, eliminating HTTP requests. Images under 10KB are commonly inlined this way. JWT tokens encode their header and payload as Base64url (a URL-safe variant). Email (MIME) uses Base64 for all binary attachments. API authenticationwith HTTP Basic Auth encodes "username:password" as Base64 in the Authorization header.
Base64 vs Base64url
Standard Base64 uses + and / characters, which are not URL-safe. Base64url (defined in RFC 4648 Section 5) replaces + with - and / with _, and commonly omits the = padding. JWT tokens, OAuth tokens, and URL parameters use Base64url because it can travel through URLs and filenames without percent-encoding. Select URL-safe mode above to encode or decode that variant directly.
MIME Base64 Line Wrapping
MIME Base64 is the email-friendly variant that wraps output at 76 characters per line. Modern APIs usually prefer unwrapped standard Base64 or Base64url, but SMTP and older MIME workflows may still expect line-wrapped encoded text. Select MIME mode to create wrapped output, or paste wrapped MIME text into decode mode and BytePane will normalize whitespace before decoding.
Common Base64 Mistakes
Using Base64 for "security" is the most common mistake — Base64 is trivially reversible and provides zero security. Never store passwords, API keys, or sensitive data as Base64 without proper encryption. Another frequent error is encoding large files as Base64 data URIs, which bloats CSS/HTML size and hurts page load performance. Files over 10KB should be served as separate resources. Finally, forgetting UTF-8 handling when encoding non-ASCII text causes corruption — always convert to UTF-8 first, as this tool does automatically.
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is commonly used to embed images in HTML/CSS, encode email attachments (MIME), pass data in URLs, and store binary data in JSON or XML.
Is Base64 encryption?
No, Base64 is NOT encryption. It is an encoding scheme that is easily reversible. Anyone can decode a Base64 string. Never use Base64 to protect sensitive data — use proper encryption (AES, RSA) instead.
What is Base64url?
Base64url is the URL-safe variant defined by RFC 4648. It replaces + with -, replaces / with _, and usually removes = padding. JWT tokens, OAuth state values, URL parameters, and filenames commonly use Base64url instead of standard Base64.
What is MIME Base64 wrapping?
MIME Base64 wraps encoded output at 76 characters per line for email compatibility. Use the MIME option when preparing text for older mail workflows or systems that expect line-wrapped Base64 output.
Why does Base64 increase the size?
Base64 encoding increases the data size by approximately 33%. This is because it converts every 3 bytes of input into 4 ASCII characters. The padding character "=" is added when the input is not a multiple of 3 bytes.
Does this tool support UTF-8?
Yes. BytePane's Base64 tool fully supports UTF-8 characters including emojis, accented characters, Chinese/Japanese/Korean characters, and any Unicode text.