HTML | DOM Window btoa() Method Last Updated : 05 Aug, 2022 Comments Improve Suggest changes Like Article Like Report 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: String: It is a mandatory parameter which specifies the string to be encoded. 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 <!DOCTYPE html> <html> <head> <title> Window btoa() Method in HTML </title> <style> h1 { color: green; } h2 { font-family: Impact; } body { text-align: center; } </style> </head> <body> <h1>GeeksforGeeks</h1> <h2>Window btoa() Method</h2> <p> For encoding a string in base-64 format, double click the "Encode Message" button: </p> <button ondblclick="encode()"> Encode Message </button> <p id="myEncoding"></p> <script> function encode() { var original = "GeeksforGeeks"; var encoded = window.btoa(original); var output = "Encoded String : " + encoded; document.getElementById("myEncoding").innerHTML = "Original String: " + original + "<br>" + output; } </script> </body> </html> Output: After clicking the button: Supported Browsers: The browser supported by Window btoa( ) Method are listed below: Google Chrome 4Edge 12Internet Explorer 10Firefox 1Opera 10.5Safari 3 Comment More infoAdvertise with us Next Article HTML | DOM Window btoa() Method S Shubrodeep Banerjee Follow Improve Article Tags : Web Technologies HTML HTML-Methods Similar Reads HTML DOM Window atob( ) Method The Window atob() method is used for decoding a base-64 encoded string. It is used to decode a string of data which has been encoded using the btoa() method. It returns a string which represents the decoded string. Syntax : window.atob(EncodedString) Parameters Used : EncodedString : It is a mandato 1 min read HTML DOM Window moveBy() Method The Window moveBy() method is used for moving a window with a specified number of pixels relative to its current coordinates. The Window moveBy() method accepts two parameters x and y which denote the number of pixels to move the window horizontally and vertically. Syntax: window.moveBy(x, y)Paramet 2 min read HTML DOM write() Method The write() method in HTML is used to write some content or JavaScript code in a Document. This method is mostly used for testing purposes. It is used to delete all the content from the HTML document and inserts the new content. It is also used to give additional text to an output that is opened by 2 min read HTML DOM open() Method The DOM Open() method in HTML is the combination of the following three steps: Opens an output stream to collect the output.Collects output from the document.write() or document.writeln() methods.Runs the document.close to display the output written to the output stream. Syntax: document.open( MIMEt 2 min read HTML DOM close() Method The DOM close() method is used to close the output stream. It is used to indicate the finish of writing on a window. The close() method does not require any parameter. Syntax:document.close()Example 1: In this example, we will use DOM close() method.HTML<!DOCTYPE html> <html> <head 2 min read Like