views:

91

answers:

5

What's the HTML character entity for the # sign? I've looked around for "pound" (keeps returning the currency), and "hash" and "number", but what I try doesn't seem to turn into the right character.

A: 

The entity is #35;.

Matthew Flaschen
+2  A: 
# or #

http://www.asciitable.com/ has information. Wikipedia also has pages for most unicode characters.

http://en.wikipedia.org/wiki/Number_sign

whatsisname
+1 for asciitable.com
David
+5  A: 

You can search it on the individual character at fileformat.info. Enter # as search string and the 1st hit will lead you to U+0023. Scroll a bit down to the 2nd table, Encodings, you'll see under each the following entries:

HTML Entity (decimal)  #
HTML Entity (hex)      #
BalusC
Thanks, those work!
chimerical
+2  A: 

There is no HTML character entity for the # character, as the character has no special meaning in HTML.

You have to use a character code entity like # if you wish to HTML encode it for some reason.

Guffa
+1  A: 

The "#" -- like most Unicode characters -- has no particular name assigned to it in the W3 list of "Character entity references" http://www.w3.org/TR/html4/sgml/entities.html . So in HTML it is either represented by itself as "#" or a numeric character entity "#" or "#" (without quotes), as described in "HTML Document Representation" http://www.w3.org/TR/html4/charset.html .

Alas, all three of these are useless for escaping it in a URL. To transmit a "#" character to the web server in a URL, you want to use "URL encoding" aka "percent encoding" as described in RFC 3986, and replace each "#" with a "%23" (without quotes).

David Cary