YouTip LogoYouTip

Met Win Atob

Window atob() Method

-- Learning is not just about technology, but also about dreams!

JavaScript Reference

Overview

JavaScript Objects

JavaScript Array Object JavaScript Boolean Object JavaScript Date Object JavaScript Math Object JavaScript Number Object JavaScript String Object JavaScript RegExp Object JavaScript Global Properties/Functions JavaScript Operators JavaScript Error

Browser Objects

Window Object Navigator Object Screen Object History Object Location Object Storage Object

DOM Objects

HTML DOM Document Object HTML DOM Element Object HTML DOM Attribute Object HTML DOM Event Object HTML DOM Console Object CSSStyleDeclaration Object DOM HTMLCollection

HTML Objects

<a> <area> <audio> <base> <blockquote> <body> <button> <canvas> <col> <colgroup> <datalist> <del> <details> <dialog> <embed> <fieldset> <form> <iframe> <frameset > <img> <ins> <input> - button <input> - checkbox <input> - color <input> - date <input> - datetime <input> - datetime-local <input> - email <input> - file <input> - hidden <input> - image <input> - month <input> - number <input> - range <input> - password <input> - radio <input> - reset <input> - search <input> - submit <input> - text <input> - time <input> - url <input> - week <keygen> <link> <label> <legend> <li> <map> <menu> <menuItem> <meta> <meter> <object> <ol> <optgroup> <option> <param> <progress> <q> <script> <select> <source> <style> <table> <td> <th> <tr> <textarea> <title> <time> <track> <video>

JavaScript Error

Navigator Object

Window atob() Method

Window Object Reference Manual Window Object


Definition and Usage

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

The base-64 encoding method is btoa().

Syntax

window.atob(encodedStr)

Parameter Description:

  • encodedStr: Required. A string encoded by 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 = "";
var enc = window.btoa(str);
var dec = window.atob(enc);
var res = "Encoded string is: " + enc + "<br>" + "Decoded string is: " + dec;

Try it yourself Β»


Window Object Reference Manual Window Object

← Met Win StopPython3 Set β†’