JavaScript Base64 Encoding

This form will let you encode and decode Base64 encoded text. A very similar method of encoding is used for holding the data for the Huffman compression method of JavaScript compression.

Type in the message you want converted and then press Encode or Decode.

source, JavaScript has been modified to use window.btoa / window.atob:

encode: document.base64Form.theText.value=window.btoa(unescape(encodeURIComponent(String(document.base64Form.theText.value))));

decode: document.base64Form.theText.value=decodeURIComponent(escape(window.atob(String(document.base64Form.theText.value).replace(/[^A-Za-z0-9\+\/\=]/g,''))));

sorry Internet Explorer users :-/

Comments