/

HTML / CSS / JavaScript Tutorial

JavaScript Window method: btoa()

[this page | pdf | back links]

The btoa() method (when applied to Window objects in the JavaScript BOM) encodes a string into base-64, using A-Z, a-z, 0-9, “+”, “/” and “=” characters to encode the string. The string can be decoded using the atob() method.

 

It has the following syntax with the following parameters. It returns the encoded string.

 

window.btoa(str)

 

Parameter

Required / Optional

Description

str

Required

String to be base-64 encoded

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile