your image

HTML URL Encoding Reference

w3schools
Related Topic
:- HTML CSS

HTML URL Encoding Reference

PreviousNext

URL - Uniform Resource Locator

Web browsers request pages from web servers by using a URL.

The URL is the address of a web page, like: https://www.w3schools.com.

URL Encoding (Percent Encoding)

URL encoding converts characters into a format that can be transmitted over the Internet.

URLs can only be sent over the Internet using the ASCII character-set.

Since URLs often contain characters outside the ASCII set, the URL has to be converted into a valid ASCII format.

URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits.

URLs cannot contain spaces. URL encoding normally replaces a space with a plus (+) sign or with %20.

Try It Yourself

If you click the "Submit" button below, the browser will URL encode the input before it is sent to the server. A page at the server will display the received input.

 

Try some other input and click Submit again.

URL Encoding Functions

In JavaScript, PHP, and ASP there are functions that can be used to URL encode a string.

PHP has the rawurlencode() function, and ASP has the Server.URLEncode() function.

In JavaScript you can use the encodeURIComponent() function.

Click the "URL Encode" button to see how the JavaScript function encodes the text.

 

Note: The JavaScript function encodes space as %20.

ADVERTISEMENT

 

ASCII Encoding Reference

Your browser will encode input, according to the character-set used in your page.

The default character-set in HTML5 is UTF-8.

CharacterFrom Windows-1252From UTF-8space%20%20!%21%21"%22%22#%23%23$%24%24%%25%25&%26%26'%27%27(%28%28)%29%29*%2A%2A+%2B%2B,%2C%2C-%2D%2D.%2E%2E/%2F%2F0%30%301%31%312%32%323%33%334%34%345%35%356%36%367%37%378%38%389%39%39:%3A%3A;%3B%3B<%3C%3C=%3D%3D>%3E%3E?%3F%3F@%40%40A%41%41B%42%42C%43%43D%44%44E%45%45F%46%46G%47%47H%48%48I%49%49J%4A%4AK%4B%4BL%4C%4CM%4D%4DN%4E%4EO%4F%4FP%50%50Q%51%51R%52%52S%53%53T%54%54U%55%55V%56%56W%57%57X%58%58Y%59%59Z%5A%5A[%5B%5B\%5C%5C]%5D%5D^%5E%5E_%5F%5F`%60%60a%61%61b%62%62c%63%63d%64%64e%65%65f%66%66g%67%67h%68%68i%69%69j%6A%6Ak%6B%6Bl%6C%6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%C3%96×%D7%C3%97Ø%D8%C3%98Ù%D9%C3%99Ú%DA%C3%9AÛ%DB%C3%9BÜ%DC%C3%9CÝ%DD%C3%9DÞ%DE%C3%9Eß%DF%C3%9Fà%E0%C3%A0á%E1%C3%A1â%E2%C3%A2ã%E3%C3%A3ä%E4%C3%A4å%E5%C3%A5æ%E6%C3%A6ç%E7%C3%A7è%E8%C3%A8é%E9%C3%A9ê%EA%C3%AAë%EB%C3%ABì%EC%C3%ACí%ED%C3%ADî%EE%C3%AEï%EF%C3%AFð%F0%C3%B0ñ%F1%C3%B1ò%F2%C3%B2ó%F3%C3%B3ô%F4%C3%B4õ%F5%C3%B5ö%F6%C3%B6÷%F7%C3%B7ø%F8%C3%B8ù%F9%C3%B9ú%FA%C3%BAû%FB%C3%BBü%FC%C3%BCý%FD%C3%BDþ%FE%C3%BEÿ%FF%C3%BF

URL Encoding Reference

The ASCII control characters %00-%1F were originally designed to control hardware devices.

Control characters have nothing to do inside a URL.

ASCII CharacterDescriptionURL-encodingNULnull character%00SOHstart of header%01STXstart of text%02ETXend of text%03EOTend of transmission%04ENQenquiry%05ACKacknowledge%06BELbell (ring)%07BSbackspace%08HThorizontal tab%09LFline feed%0AVTvertical tab%0BFFform feed%0CCRcarriage return%0DSOshift out%0ESIshift in%0FDLEdata link escape%10DC1device control 1%11DC2device control 2%12DC3device control 3%13DC4device control 4%14NAKnegative acknowledge%15SYNsynchronize%16ETBend transmission block%17CANcancel%18EMend of medium%19SUBsubstitute%1AESCescape%1BFSfile separator%1CGSgroup separator%1DRSrecord separator%1EUSunit separator%1F

Comments