HTML | DOM Window btoa() Method (original) (raw)

Last Updated : 5 Aug, 2022

The Window btoa() method is used for encoding a string in base-64 format.
The characters used by the Window btoa() method to encode the string are "A-Z", "a-z", "0-9", "+", "/" and "=" .

Syntax:

window.btoa(String)

Parameters Used:

Return Value: It returns a string that represents the encoded string of base-64.

Below program illustrates the Window btoa() Method:

Encoding a string in base-64 format.

html `

Window btoa() Method in HTML