Base64 Encoder & Decoder
Encode and decode text strings, binary data, and files to and from Base64 format. Features UTF-8 Unicode compatibility and URL-safe variants.
Mode:
Plaintext / UTF-8 Input
Size: 29 bytes
Base64 Result
Size: 0 bytes
How to Encode and Decode Base64
- Choose Mode: Select Encode to transform raw text or files into Base64, or Decode to convert Base64 back into human-readable plaintext.
- URL-Safe Encoding: Check URL-Safe Base64 when generating strings for URL query parameters or file names, replacing reserved
+and/characters with-and_. - File Upload Support: Click Encode File to drag and drop local images or PDF documents and convert their raw binary payload into Base64 data strings.
- Copy or Export: Click Copy to send the result to your clipboard or Download as a
.b64or.txtfile.
Why Does Base64 Increase Data Size by 33%?
Computers store data in 8-bit bytes (256 possible values). However, legacy network protocols like SMTP email and older HTTP headers were designed exclusively for 7-bit ASCII text. Base64 bridges this gap:
- 6-Bit Binary Slicing: Base64 divides incoming binary streams into 6-bit chunks (representing numbers 0 to 63), each corresponding to one of 64 printable characters.
- 3-to-4 Expansion Ratio: Every 3 bytes of input data (24 bits) require 4 Base64 characters (24 bits) to transmit, mathematically resulting in an exact 33.3% increase in payload size.
Crucial Distinction: Encoding vs. Encryption
Base64 Offers Zero Confidentiality
Base64 is a data representation format, not encryption. Anyone who intercepts a Base64 string can decode it instantly without a key or password. Never use Base64 alone to protect passwords, personal identification numbers, or secret API keys.