Decode a base-64 encoded string:
let text = "Hello World!";
let encoded = window.btoa(text);
let decoded = window.atob(encoded);
Try it Yourself »
The atob()
method decodes a base-64 encoded string.
The atob()
method decodes a string that has been encoded by the btoa()
method.
window.atob(
encoded)
Parameter | Description |
encoded | Required. The string to be decoded. |
Type | Description |
A string | The decoded string. |
atob()
is supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 10-11 | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!