Encoding

URL Encoding: Spaces, Symbols and Query Parameters

Understand percent encoding and when to encode a full URL versus a single parameter value.

Related tool

URL Encoder / Decoder helps you apply this guide directly in the browser.

Open tool

Why URLs need encoding

URLs use certain characters for structure. A question mark starts a query string, an ampersand separates parameters and a hash starts a fragment.

When those characters are part of a value, encoding prevents the browser or server from reading them as structure.

Parameter values are usually the target

Most of the time, you encode a parameter value rather than an entire URL.

Encoding a full URL is useful when one URL is being passed inside another URL, such as a redirect parameter.