HomeDeveloper ToolsURL Encoder
🔗 Percent-Encoding Utility

URL Encoder & Decoder Studio

Encode unsafe characters into valid percent-encoded URL formats or decode encoded URI strings.

Percent-encoding under RFC 3986

URLs may only contain a limited set of ASCII characters. RFC 3986 calls letters, digits, hyphen, full stop, underscore and tilde unreserved; they never need encoding. Characters such as : / ? # [ ] @ ! $ & ' ( ) * + , ; = are reserved because they separate the parts of a URL, and must be encoded when they appear inside a value.

Everything else, including spaces and any non-ASCII character, is first converted to UTF-8 bytes and each byte is written as a percent sign followed by two hex digits. The euro sign is three UTF-8 bytes, E2 82 AC, so it becomes %E2%82%AC.

Worked example: encoding a query value

Take the value price=10€ & size=M/L. Encoded as a component it becomes price%3D10%E2%82%AC%20%26%20size%3DM%2FL. The equals sign became %3D, the ampersand %26, the slash %2F, each space %20 and the euro sign its three-byte sequence.

Without encoding, a server would read that ampersand as the start of a new parameter and the equals sign as a key-value separator, splitting your value into fragments.

This tool uses JavaScript's encodeURIComponent, which leaves ! ' ( ) and * unencoded. Most servers accept that, but some signature schemes, such as OAuth 1.0 (RFC 5849), require those characters to be encoded too, so add that extra step when building signed requests.

Build URLs from encoded parts

Encode each path segment and each query value separately, then join them with the literal separators. Encoding the finished URL as one string turns its own slashes and question mark into %2F and %3F and breaks it. In code, URLSearchParams or your HTTP library's query builder handles this for you.

Double encoding is the classic bug in this area. Encoding 100% gives 100%25, and encoding that again gives 100%2525. If you see %25 followed by two hex digits, such as %2520 for a space, a value has been encoded twice somewhere in the chain.

Decoding pitfalls

HTML forms submitted with GET use application/x-www-form-urlencoded, where a space is written as a plus sign. The decoder here follows decodeURIComponent and leaves plus signs untouched, so for form data replace each + with a space before decoding.

Decode exactly once, at the point where you use the value. Decoding twice can turn an innocent %2525 into a live %25 and open the door to path traversal, where a sequence such as %2e%2e%2f becomes ../ after decoding. Validate decoded values, not encoded ones.

URL Encoder / Decoder: frequently asked questions

Which characters can appear in a URL without encoding?

Letters A to Z and a to z, digits 0 to 9, and the four symbols hyphen, full stop, underscore and tilde are always safe. Reserved characters such as / ? & = are allowed only in their structural role, and must be encoded inside a value.

Why does one accented letter turn into several percent codes?

Percent-encoding works on UTF-8 bytes, not characters. The letter é is two bytes in UTF-8, so it becomes %C3%A9, and many emoji are four bytes and become four codes. Browsers often show the decoded character in the address bar but send the encoded bytes.

Do I need to encode the # character?

Yes, if it is part of a value. An unencoded # starts the fragment, and browsers do not send the fragment to the server, so everything after it silently disappears from the request. Encode it as %23.

Is URL encoding the same as HTML entity encoding?

No. URL encoding makes text safe inside a URL, using percent codes such as %26 for &. HTML encoding makes text safe inside an HTML page, using entities such as &. A link in an HTML attribute may need both, applied in that order.

All developer utilities & crypto