본문으로 바로가기

Character Entities That Should be Encoded in URLs

URLs have a limited number of characters that you can use for domains, directories, and file names. These characters are:

A-Z, a-z, 0-9, -, ., _, ~, :, /, ?, #, [, ], @, !, $, &, ', (, ), *, +, ,, ; and =

Some of these characters have specific, reserved meanings and you can only use them in a URL for that purpose. Any other character in a URL or using a reserved character for a different use should be encoded with the following codes.

Characters With a Reserved Usage

The following table gives a list of the common characters that should not be written in URLs, except in their appropriate usage:

Character Purpose in URL Encoding
: Separate protocol (http) from address %3B
/ Separate domain and directories %2F
# Separate anchors %23
? Separate query string %3F
& Separate query elements %24
@ Separate username and password from domain %40
% Indicates an encoded character %25
+ Indicates a space %2B
~ Indicates a user directory %&E

Characters You Should Always Encode in URLs

And this table lists some common characters you should not use in URLs at all unless you use the encoded version.

Note that there are many more characters on the “do not use” list that are not included here. If you need to use these characters you need to find out the URL encoding for them.

Character Purpose in URL Encoding
<space> Invalid in URLs %20 or +
; Invalid in URLs %3B
= Invalid in URLs %3D
$ Invalid in URLs %26
, Invalid in URLs %2C
< Invalid in URLs %3C
> Invalid in URLs %3E
^ Invalid in URLs %5E
` Invalid in URLs %60
\ Invalid in URLs %5C
[ Invalid in URLs %5B
] Invalid in URLs %5D
{ Invalid in URLs %7B
} Invalid in URLs %7D
| Invalid in URLs %7C
" Invalid in URLs %22

번역은 필요없잖아요