Base64 Conversion Utility

Need to decrypt that garbled text string you got in an email? Or data encoded in a configuration file? Concerned about the security of that data? My base64 encoder/decoder process the request in your browser with javascript, so your data doesn't touch my server.

Direction

About Base64 Encoding

"Base64" can refer to a variety of encoding types that take binary data and convert it to text for safe transport over systems like email that do not guarantee safe transit of binary data. The name Base64 comes from the MIME content-transfer-encoding that uses this scheme. 64 refers to the 64 characters that are used to represent the encoded data. Most Base64 encoding schemes use A–Z, a–z, and 0–9 for the first 62 characters. The last two characters may differ between encodings; the MIME specification uses "+" and "/" to complete the sequence. A 65th character, "=" is used to pad the content to a multiple of 24 bits in length. This site will help you decode text that was encoded with Base64 to protect special characters or whitespace within the text. Base64-encoded data could also represent images or other binary data types. If you need help sleeping, you can read section 6.8 of IETF RFC 2045 which is the official definition of the specification.

But my text got longer when I encoded it. What's up with that? Yes, base64 encoded text is longer than the unencoded text it represents. Text is generally stored in a computer system with a bit depth of 27 or 128 possible values per position. Base64, as its name implies, has to represent all of those values with a bit depth of only 64 or 26, so one character in the source text is shared between characters of the encoded text. It's probably easiest to show how this works visually:

Source Text A l e x
Decimal Value 65 108 101 120
Binary Value 0 1 0 0 0 0 0 1 0 1 1 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 1 1 1 0 0 0
Decimal Value 16 22 49 37 30 0
Base64 Symbol Q W x l e A = =

Thanks

Thanks to the people who inspired me to work on this project and the resources that made it possible: my employer, Epic, where I needed to do this conversion as part of supporting my customers and that taught me to be paranoid about who has my data; the folks behind Base64 Decode and Encode - Online, who got most of the way there, but make me submit the data to their server for the conversion; and php.js who, while I find the concept a little absurd, do make it quite easy to implement some things in javascript that are typically done server side. Many thanks also to my domain registrar, Hover and server provider Panix.