Last Updated: September 09, 2019
·
2.191K
· franklinjavier

Native support to encode/decode base64 in javaScript

You can create a base64 encoded ASCII string from a "string" of binary data.

var encodedData = window.btoa( "Franklin Javier" ); // encode a string
var decodedData = window.atob( encodedData ); // decode the string

Basic support: Chrome, Firefox, IE10, Opera, Safari