http://iharder.sourceforge.net/current/java/base64/ This is a Public Domain Java class providing very fast Base64 encoding and decoding in the form of convenience methods and input/output streams. There are other Base64 utilities on the Internet, some part of proprietary packages, some with various open source licenses. In any event, I hope with one or more of these Base64 tools, you won't have to write your own like I did. If you use Maven, thank Owen O'Malley from Apache and Matthew from Sensible Development for working up a Base64 Maven Repository. Thanks to Brian Burton for providing this Base64Test.java test class for use with JUnit.org. (The test file hasn't been updated in a while.) You may view the Base64 javadoc API online, if you like.