Valid URL Characters: Safe & Unsafe Character List

Writing URLs on laptop

You will have noticed that some special characters seem to be able to slip into a URL (commas are often the culprit) while others don’t. There are a number of characters other than the standard numbers and letters you are used to that can work in URLs.

 

Valid URL Characters: Which Characters Are Allowed in URLs?

Not all special characters will cause an issue in your URLs. There are many safe characters. Other non-safe characters risk poor readability, breaking some browsers and causing issues for crawlers.

Safe characters

Standard (safe) characters:
0 1 2 3 4 5 6 7 8 9
a b c d e f g h I j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Special characters:
$ – _ . + ! * ‘ ( ) ,

And reserved characters like ? (used to denote a query)

 

Should I Use Special (Reserved) Characters in URLs?

It is common for websites to use alphanumeric character and only one special character, the hyphen, to separate words.

It is unlikely that anyone would expect to see or type a special character other than the hyphen into a URL. For that reason, as well as it looking messy and the risk of accidentally including unsafe characters, I’d always stick to alphanumerics and the hyphen.

 

Unsafe URL Characters: Which Characters Aren’t Allowed in URLs?

Any character not in the ‘Safe character’ list above is unsafe and cannot be used in a URL.

Unsafe characters are unsafe for different reasons. Many have common uses in different systems so might result in an undesired outcome which may break the URL.

Unsafe characters:

[ ] { } | \ ” % ~ # < >

or anything that isn’t one of the safe characters listed above.

 

Why don’t some characters work?

Unsafe characters can lead to unexpected behaviour.

For example, the space character shouldn’t be used because the spaces might disappear or change when the URLs are transcribed or used in different word-processing systems.

If necessary, these unsafe characters can be encoded into the URLs.

Overall, I would recommend sticking with alphanumerics only.

 

Should I Include Short Words Like ‘and’ and ‘the’?

There is no need to use short words like this, known as stop words.

Stop words are words which are filtered out by search engines like Google and Bing when processing of natural language data. They are often the words which don’t contain importance of significance.

For example, if the title of your page is:

The best guide to making lemonade you will ever find

You’d avoid a URL that exactly matches the title, like this:

www.example.com/the-best-guide-to-making-lemonade-you-will-ever-find/ 

Instead, you should go for something shorter and easier to read which is just as good for users and search engines:

www.example.com/best-guide-making-lemonade/

or

www.example.com/making-lemonade-guide/

Of course, you can add stop words if you want to make URLs slightly more attractive. However, the inclusion of unnecessary words is also going to increase the length of your URLs which is something best avoided where possible.

Valid URL Characters: Safe & Unsafe Character List

2 thoughts on “Valid URL Characters: Safe & Unsafe Character List

  • 13th June 2018 at 11:27 am
    Permalink

    What about ‘=’ and ‘?’

    Reply
    • 13th June 2018 at 12:00 pm
      Permalink

      Hi David,

      Thanks for leaving your comment. Good question!

      ‘?’ and ‘=’ are reserved characters, just like characters such as ‘/’, ‘;’ and ‘@’.

      They’re reserved for a specific purpose and should only be used for that purpose – for example, ‘?’ should precede a query and ‘/’ for different paths.

      Best to avoid unless you’re using them for their specific purpose. I hope that helps answer your question!

      Thanks,

      Abra

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Keep updated

Get all the latest digital marketing tips, guides and news straight to your inbox