Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Window atob() method

Window atob() method

Window Object Reference Window Object


Definition and Usage

The atob() method is used to decode a string encoded with base-64.

The base-64 encoding usage is btoa() .

Syntax



window.atob(encodedStr)

Parameter Description:

Return Value

This method returns a decoded string.


Browser support

The numbers in the table indicate the first browser version that supports this method.

Method
atob() Yes 10.0 1.0 Yes Yes

Example

Example

Display an alert box:

var

str

=

"

RUNOOB

"

;

var

enc

=

window

.

btoa

(

str

)

;

var

dec

=

window

.

atob

(

enc

)

;

var

res

=

"

The encoded string is:

"

enc

"


"

"

The decoded string is:

"

dec

;

Try it »


Window Object Reference Window Object