Skip to main content
miji.be

URL encoding of space, + and %

The space, + and % encode differently depending on the method. This table compares encodeURIComponent, encodeURI and form submission.

Characters in this table: 3

Encoding table

Methodspace+%
encodeURIComponent%20%2B%25
encodeURI%20+%25
Form submission+%2B%25
Code pointU+0020U+002BU+0025
UTF-8 (hex)202B25
RFC 3986 classOtherReserved (sub-delims)Other

The encoded value is the result of JavaScript's encodeURIComponent applied to each character. A character that is encoded is written as % followed by two hexadecimal digits for every UTF-8 byte.

The classes follow RFC 3986. Unreserved characters can appear in a URL as they are. Reserved characters delimit the parts of a URL, and encodeURIComponent leaves the reserved characters ! ' ( ) * unencoded. Other characters are always encoded.

In form submission (application/x-www-form-urlencoded), a space becomes + and + itself becomes %2B. encodeURI and encodeURIComponent turn a space into %20.

Convert any text

For characters not in these tables, or for whole sentences, use the URL encoder / decoder.

Open the URL encoder / decoder

Other character types

Related terms