TIP: Url Encoding (or Hex encoding)

0 comments suggest edit

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.

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

8 responses

  1. Avatar for Kyle
    Kyle February 4th, 2004

    You are officially a big dork.

  2. Avatar for erik
    erik February 4th, 2004

    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.

  3. Avatar for nospamplease75@yahoo.com (Haac
    nospamplease75@yahoo.com (Haac February 4th, 2004

    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.

  4. Avatar for Ben
    Ben April 13th, 2005

    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.

  5. Avatar for john
    john May 25th, 2005
  6. Avatar for dom
    dom December 6th, 2006

    okay so can i use hex encoding to get past filters on my uni network proxy?

  7. Avatar for moh
    moh August 25th, 2007

    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.

  8. Avatar for jordotech
    jordotech March 18th, 2010

    hey guys, theres a great firefox add-on called hackbar that does url encoding really easily. its really convenient