Last Updated: September 09, 2019
·
2.408K
· 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

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.

Security insights from Cside