Technology & Web Resources For Your Business
Home > Tech > Web Development > A Complete Guide to URL Escape Characters

A Complete Guide to URL Escape Characters

How do we keep this site running? This post may contain affiliate links — the cost is the same to you, but we get a referral fee. Compensation does not affect rankings. Thanks!

Spectacles on eye chartIn order to prevent the misinterpretation of special characters such as a space, bracket (< and >), or % in the URL (which stands for Uniform Resource Locator – it is the address you see in your browser’s address bar indicating the location of the website you are visiting), browsers parse certain special characters using URL escape characters. This explains why when you click on a link such as: domain.com/page one.htm you see it parsed in the address bar as example.com/page%20one.htm. In this case the %20 is the escape character for the space.

Mass find and replace for documents or web pages

Chances are you’re looking up the code for a URL escape character because you’re a web designer, or at least building and designing your own web site. One of the biggest pains in web design can be the need to update a small piece of content on multiple pages. In this case, if you’re needing to update a URL escape character, it will be a pain in the butt to have to open a dozen files individually and make the change. In comes FAR Find & Replace software. Why pay $100 for Homesite (the only other software that does reliable mass find and replace for HTML or CSS documents), when you can use opensource FAR for free?

It’s powerful and efficient, and compatible with Windows operating systems. It works with all documents, not just web page files. With it, you can change or update multiple web pages/files at once, including multiple instances of URL escape characters. Whether it’s a link, a copyright notice, or simply a spelling mistake – you’ll be able to update hundreds of web pages or text documents at once, without having to edit edit each of them manually.

What You See is What You Get (WYSIWYG) HTML Editor

If you’d like to take the hassle out of hand-coding your escape characters, checkout the free open source elRTE web page (HTML) editor. No technical knowledge required – what you see is what you get. In other words, if you’re familiar with using Word Processing software, you should have no problem using elRTE to easily create web documents and web pages. You can even create an entire website of your own from the bottom up – without any programming experience. We’re curious to hear how you like elRTE, given that there are many other solutions available. Let us know in the comments, we want to post the best option here for our readers.

Common URL Escape Characters

Table of URL Escape Characters
CharacterEscape CharacterCharacterEscape Character
Space%20#%23
$%24%%25
&%26@%40
`%60/%2F
:%3A;%3B
<%3C=%3D
>%3E?%3F
[%5B\%5C
]%5D^%5E
{%7B|%7C
}%7D~%7E
%22%27
+%2B,%2C

 

Good Coding Practice

It is good coding practice to avoid the need for URL escape characters. As a rule of thumb, avoid using the special characters above when formulating a URI string (filename), and I recommend using the hyphen (-) instead of the underscore (_) (as all search engines recognize the hyphen as a space separator, but the same is not true for the underscore; and older browsers do not correctly interpret the underscore in CSS). If you must use the above characters make sure to escape them using the above escape characters so when the browser parses your code it will not misinterpret the link. It’s important to note that these URL escape characters differ from HTML escape characters.

Looking for HTML (XHTML) Escape Characters?

Visit our page on HTML Escape Characters for a list of valid HTML (and XHTML) escape characters.


About Alex Schenker
Alex bring a series of in-depth articles on search marketing and content management systems as well as troubleshooting tips to We Rock Your Web's collection. He is an avid tennis player, nature enthusiast, and hiker, and enjoys spending time with his wife, friends, and dogs, Bella and Lily.
Previous:
Next:

Leave a Reply

34 Comments on "A Complete Guide to URL Escape Characters"

avatar
Sort by:   newest | oldest | most voted
Margit Willems
Guest

Hi Alex, thank you so much for putting this handy list together. I’m not a coder, hence, it helps so much when tweaking the permalink to match with headline.

Alex Schenker
Guest
Alex Schenker

You’re very welcome Margit, glad you found it useful!

Anonymous
Guest
Anonymous
Proper coding is key to the successful creation of websites, especially as scripting languages continue to develop and become more complex. A good framework and foundation will keep any web developer savvy enough to perform well and avoid costly mistakes. Small business owners should also keep this principle in mind. Just because someone is a web developer does not mean they are a good one. Just because someone can offer the solutions that you need to solve your web site problems does not mean they can do it without errors. When looking for a web developer, make sure they come… Read more »
Anonymous
Guest
Anonymous

Hi, can anyone share what the escape character is for a hyphen in the URL. This is urgent.

Web Rocker
Guest
Web Rocker

The hyphen doesn’t need to be escaped. Use it as is (ie. example.com/this-page).

Anonymous
Guest
Anonymous
What will the future of coding look like? Will we be able to solve these errors more automatically in the future – at least with web scripting? Granted, the solution described here is relatively elegant and straightforward compared to the clumsier (but also, in certain situations, more useful) situations found in older or alternative types of coding. However, will the future bring a rosier hue to such coding misadventures? We can hope. Actually, we can do a lot more than hope, we can look ahead and forecast and plan, too. Some things are obvious to predict. For example, conversion services,… Read more »
a web rocker
Guest
a web rocker

Provided that a suitable rocket miniaturization technology is developed we might also soon expect personal jet-packs.

Essentially you’ve said nothing.

Anonymous
Guest
Anonymous
As code used becomes higher and higher in terms the type of language it is and what it controls, these annoying little mistakes will also start to become things of the past. Of course, high program languages have their own downsides. If compilers and modern interfaces make languages too high, the problems they create will also be much higher. Essentially, this means that small things like escape characters will have a very high chance of being synced and operating correctly when they are updated, but when things go wrong they will go wrong on a major scale. Even worse, the… Read more »
ynca99
Guest
ynca99

Hi guys,

I need some help about blocking weird characters like:

?D=<<<<< <<<<<foo”bar’204>>>>> in my htaccess file.

Could you please give me a hand? Many thanks.

Anonymous
Guest
Anonymous

Hi, can any one share what is the Escape character for ‘(‘ and ‘)’ ??

Web Rocker
Guest
Web Rocker

The escape characters for left and right parenthesis are:

* ( is (
* ) is )

Isaac Gilmour
Guest
Isaac Gilmour

Those are the HTML Escape characters, the URL escape characters are:

( is %28

) is %29

Note: Javascript has a function “escape” which will convert normal text to URL escaped text, and “unescape” converts URL escaped text to normal text

Anonymous
Guest
Anonymous

Hi, thanks for your great page. I was trying to … I dunno… trying to make sense out of urls, but I didn’t know what to replace some of the characters with, namely, %3B. You helped a lot. 🙂

I guess I was trying to unobfuscate them? lol…. I found your page on google with the keywords search %3B replace html

Have a nice day!

Karen May Jones

Anonymous
Guest
Anonymous

Thanks!

user1
Member

Our HTML (and XHTML) Escape Characters List is finally complete. Click the link in the article above to access the page.

Anonymous
Guest
Anonymous

Finally a list of URL escape characters I can read and make sense of. Your website layout actually makes the list readable, as opposed to some others I found. Thank you!!

Anonymous
Guest
Anonymous

Use escape(String); This is helpful in JavaScript. For more help just reply here.

Anonymous
Guest
Anonymous

Great article. Question is – do URL escape characters matter in Windows Explorer? In other words, can I name a folder “Folder Name”, or should I name it “Folder-Name”?

We Rock Your Web
Guest
We Rock Your Web

That’s a great question. The answer depends on whether the folders will ever be hosted online. In other words, if someone tries to access the folder or files via a web browser, the spaces will be interpreted as characters. In the Windows environment alone, however, there is no need to replace spaces with hyphens.

Anonymous
Guest
Anonymous

Nice – a nice concise table of URL escape characters, just what I was looking for. Now is there any way to get the entire list?

Anonymous
Guest
Anonymous

%60 is not to be confused with %27

Anonymous
Guest
Anonymous
Good Morning, Wonder if someone has come across the following problem: We call a legacy embedded browser component with a file location on the hard drive. (The file contains a post request that has been generated by our program) The file is written to my documents. D:\Users Documents\User1\My Documents\Req1.html The browser doesnt like the spaces in the directory. D:\Users Documents\Req1.html –> Fails D:\Users%20Documents\Req1.html –> Works So the spaces should eb escaped but the following fails: D:\Users%20Documents\User1\My%20Documents\Req1.html I tested it with other directories as well (custom C:\aa\ and C:\a a\) and the same result. It keeps failing if the file name… Read more »
Anonymous
Guest
Anonymous

This is a great list to get me started, thanks. But I know this can’t be all the URL escape characters. Is there any way you could post all of them? I’d be much obliged 🙂

We Rock Your Web
Guest
We Rock Your Web

Those are all the URL escape characters you should need. If there’s a specific one you’re looking for or you notice one that you’re missing, please comment and let us know – we’ll be happy to add it 🙂

Anonymous
Guest
Anonymous

I have to change the URL. What should I do?

Anonymous
Guest
Anonymous
Escape | Escape Character Sequence | Character Sequence ———————–+———————– Space %20 | ; %3B & %26 | = %3D < %3C | ? %3F > %3E | @ %40 ” %22 | [ %5B # %23 | \ %5C $ %24 | ] %5D % %25 | ^ %5E ‘ %27 | ` %60 + %2B | { %7B , %2C | | %7C / %2F | } %7D : %3A | ~ %7E
We Rock Your Web
Guest
We Rock Your Web

Thanks for sharing those! We’ll add them right away.

Anonymous
Guest
Anonymous

Thanks so much this really helped me a lot. Thanks again a lot.

Anonymous
Guest
Anonymous

Good stuff. Do you also have a list of common html escape characters handy?

user1
Member

I’m working on that – I’ll add it the next chance I get.

juju
Guest
juju

I want to add the + (plus) character to my URL. How can I do this?

Alex Schenker
Guest
Alex Schenker

Hi Juju,

You can either use the + character directly, or escape it with %2B. If you want to use the plus character in the host part of your domain name (ie. host+.com), I’m afraid you’ll be unable to do so.

Gui
Guest

Alex, what about %25? It is the percentage symbol itself. All other characters are transformed just fine but several sites break when the %25 is called.

Alex Schenker
Guest
Alex Schenker

Which part of the URL are you applying the %25 to? It should work in the path, but will not in the host (ie. host.com/path). Because the % character serves as the indicator for percent-encoded octets (ie. %22 is “), it can be escaped with %25.

wpDiscuz

Send this to friend