TIP: Url Encoding (or Hex encoding)

Quick, what's the hex code for question mark? How about the ampersand? Since, like me, you probably don't waste valuable space in your brain with that type of information, I have a little trick for you to quickly look up the hex encoding (or URLEncoding) for a character that doesn't require you building an ASP or ASP.NET page and calling Server.UrlEncode().

Go to Google and type the character in the search box and then click "Google Search". Now look in your address bar at the very end. Everything after the "q=" is the encoding of your character. For example, if I search on "?" I get:

http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=%3F

Thus the hex encoding for ? is %3F.

What others have said

Requesting Gravatar... Kyle Feb 05, 2004 1:58 AM
# re: TIP: Url Encoding (or Hex encoding)
You are officially a big dork.
Requesting Gravatar... erik Feb 05, 2004 2:27 AM
# re: TIP: Url Encoding (or Hex encoding)
First, I agree with Kyle.

Second, you could also use an online tool such as http://www.network-tools.com.

Third, I haven't asked Ben, but I'm sure he would agree with my first point.

.e.
Requesting Gravatar... nospamplease75@yahoo.com (Haacked) Feb 05, 2004 2:38 AM
# RE: TIP: Url Encoding (or Hex encoding)
I tried URLEncoding "?" with the network-tools site and received the following error:

Bad Input. Input can only contain numbers, letters, ".", "-", or "=". Input must contain at leat one "." to be valid.

At least it still worked and gave me: %3F

Still not as quick as my google trick, but a useful site nonetheless.
Requesting Gravatar... Ben Apr 14, 2005 12:41 AM
# re: TIP: Url Encoding (or Hex encoding)
I agree with erik's first point.

Try to write å and search for it in Google. This returns:
http://www.google.com/search?hl=en&lr=&q=%C3%A5

So... å should be %C3%A5 in hex - right.

Well, it's not. It's %E5 in hex.

Bad luck, Haacked.
Requesting Gravatar... john May 25, 2005 7:15 PM
# re: TIP: Url Encoding (or Hex encoding)
try this page
http://tools.devshed.com/webmaster-tools/url-encoding/
Requesting Gravatar... dom Dec 06, 2006 8:57 PM
# re: TIP: Url Encoding (or Hex encoding)
okay so can i use hex encoding to get past filters on my uni network proxy?
Requesting Gravatar... moh Aug 25, 2007 5:45 PM
# re: TIP: Url Encoding (or Hex encoding)
This is pretty cool trick! thanks.

å is %C3%A5 in hex in utf-8 encoding which is the one displayed in the URL field. It's %E5 in hex in Unicode.
Requesting Gravatar... jordotech Mar 18, 2010 8:04 AM
# re: TIP: Url Encoding (or Hex encoding)
hey guys, theres a great firefox add-on called hackbar that does url encoding really easily. its really convenient

What do you have to say?

(will show your gravatar)
Please add 3 and 7 and type the answer here: