Toolkit Lab

Guides / Web basics

What Is URL Encoding (Percent-Encoding)?

Web addresses can only contain a limited set of characters. URL encoding replaces anything else with a percent sign and two hex digits, so a space becomes %20.

Why encoding is needed

A URL uses characters such as ?, &, = and / with a special meaning. If a value you put in a link contains one of those characters, the browser may read it as part of the address. Encoding turns the value into a safe form that can be passed through unchanged.

How it works

Each unsafe byte is written as a percent sign followed by its two-digit hex code. A space is %20, an ampersand is %26, and an equals sign is %3D. The receiving site decodes the value back to the original text.

Which function to use

Plus signs and spaces in forms

HTML forms often encode spaces as + rather than %20. Both mean a space in query strings, but a plus sign inside a path is taken literally, so check which form the receiving site expects.

Try it yourself

The URL Encoder and Decoder converts text in both directions. Nothing you type is sent to a server.