Skip to content
Search

Percent-encoding

lastmod 2018-11-22created 2018-11-223 edits

(Also accessible via URL encoding)

Percent-encoding is a character encoding method for representing characters in a URL. Under this method, values other than a few characters such as letters and digits are grouped into octets and encoded as hexadecimal values.

Specification

The percent-encoding rules are defined in RFC 3986. According to this RFC, there are reserved characters that have important uses in URLs, and also unreserved characters that need no encoding.

The reserved characters are as follows. Some of them carry important syntactic meaning in URIs, so they must be encoded unless they are used with that meaning.

RFC 3986 section 2.2 Reserved Characters (January 2005)

!

*

'

(

)

;

:

@

&

=

+

$

,

/

?

#

[

]

The unreserved characters are as follows. These characters do not need percent-encoding, and it is recommended not to encode them.

RFC 3986 section 2.3 Unreserved Characters (January 2005)

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

0

1

2

3

4

5

6

7

8

9

-

_

.

~

Favorite site

author Zer0 sitemap