Web TextEncoder API | TextEncoder encode() method Last Updated : 20 Aug, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report In HTML there is a TextEncoder Interface which has a method encode() which returns an integer array containing the input parameter in encoded form. Syntax: var str = encoder.encode( str ); Return: It return an Uint8array that contains the text which is given in parameters encoded with the specific method for that TextEncoder object. Example: This example uses TextEncoder encode() method. html <!DOCTYPE html> <html> <head> <title> Web TextEncoder API | TextEncoder encode() method </title> </head> <body style="text-align:center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h3>Web TextEncoder API | TextEncoder encode() method</h3> <button onclick="getTextEncoder ();"> Get encoded form </button> <p>Text = "Welcome to GeeksforGeeks"</p> <p id='TextEncoder'></p> <script type="text/javascript"> function getTextEncoder() { var string = "geeksforgeeks is best"; var textEncoder = new TextEncoder(); let encoded = textEncoder.encode(string); document.getElementById("TextEncoder").innerHTML = "Encoded form:" + encoded; } </script> </body> </html> Output: Before clicking the button: After clicking the button: Supported Browsers: The browsers supported by TextEncoder encode() method are listed below: Google Chrome 38 Firefox 19 Opera 25 Safari 10.1 Comment More infoAdvertise with us Next Article D3coder - Browser Extension to Encode or Decode D DeepakDev Follow Improve Article Tags : Web Tech Web-API Similar Reads Web API | TextDecoder decode() Method The decode() method in TextDecoder API is used to takes a stream of bytes as input and emits a stream of code points. The TextEncoder decode() method takes an ArrayBuffer containing the encoded data and options object and returns the original string (i.e. decoded string). Syntax: decoder.decode(buff 2 min read Web API TextEncoder encodeInto() Method The encodeInto() method in TextEncoder API is used to take stream of points and emits the stream of UTF-8 bytes. All instances of TextEncoder only support UTF-8 encoding. The TextEncoder.encodeInto() takes a string to encode and an array to hold the encoded result and returns an object back. Syntax: 2 min read TextDecoder Web API | TextDecoder constructor In HTML there is a TextDecoder Interface of which we can create a TextDecoder object for the encoding specified in parameter. Syntax: decoder = new TextDecoder( utf-Label, option ); Parameters: This constructor accepts two parameters which are mentioned above and described below: utf-Label: Label of 2 min read Node.js TextEncoder The TextEncoder is an interface that takes a stream of code points as input and emits a stream of encoded UTF-8 codes. This is provided in NodeJS as an implementation of the WHATWG Encoding Standard 'TextEncoder' API. All instances of TextEncoder only support UTF-8 encoding. UTF-8: It is an encoding 2 min read D3coder - Browser Extension to Encode or Decode D3coder extension enables us to encode and decode selected text via the context menu. It reduces the time we spend looking up values and gives us more time to concentrate on the important things of development. One can even choose how to display the result, like whether to display the result using a 3 min read Java.net.URLEncoder class in Java This class is a utility class for HTML form encoding. Encoding makes the form of URL more reliable and secure. When the user request is triggered by a get method, the form parameters and their values are appended at the end of URL after a '?' sign. The problem arises when special characters are used 3 min read Like