BytePane

Base64 Encode & Decode

Encode text to Base64 or decode Base64 strings back to plain text. Supports UTF-8 characters.

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.

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 authentication with 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 omits the = padding. JWT tokens, OAuth tokens, and URL parameters use Base64url exclusively. When working with URLs or filenames, always use Base64url to avoid encoding issues. This tool supports standard Base64 — for Base64url, simply replace + with - and / with _ in the output.

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.

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.

Related Tools