# What are the valid names as labels?

What are the valid characters to use in labels? I thought that only alphabetic characters were valid, but I tested ' and ! and they work. What are the restrictions to these names?

-

Also some of the special characters can be employed: &, _, ^, but not %, ~, #, and \. Even { and } might be used, as long as they are properly balanced. However this is not recommended practice. The underscore and & may be useful delimiters for giving structure to the labels; often the colon is used for this.
Warning. Some characters might give problems when babel is loaded along with varioref (for example the colon : with French and the double quote " with many languages). Without varioref these should be OK. As Martin points out, some packages might redefine _, making it unusable in labels.
I disagree on # and ~. Both generate errors for me. # can't be used in macro definitions done internally by \label and ~ can expand to \nobreakspace {} which will break when written to the .aux file. Also some people like to redefine _ which would also break if it is defined fragile. I would avoid all characters special to TeX and also all non-ASCII characters. –  Martin Scharrer May 15 '11 at 22:21
@user14996 Yes, there's no problem in using them; -- is transformed into an en dash at a deeper level, at printing time, not when tokens are formed. –  egreg Sep 3 '12 at 9:29