Window atob()Method

Window 对象参考手册Window Object


Definition and Usage

The atob() method is used to decode a string that has been encoded using base-64 encoding.

The base-64 encoding method isbtoa() 。

Syntax

window.atob(encodedStr)

Parameter Description:

  • encodedStr: Required. A string that has been encoded using the btoa() method.

Return Value

This method returns a decoded string.

Browser Support

The numbers in the table specify the first browser version that fully supports the method.

Method
atob() Yes 10.0 1.0 Yes Yes

Example

Example

Display an alert box:

var str = "EXAMPLE"; var enc = window.btoa(str); var dec = window.atob(enc); var res = "The encoded string is:" + enc + "<br>" + "The decoded string is:" + dec;

Try it Yourself »

Window 对象参考手册Window Object

Other Extensions