UtilHub

URL Encode / Decode

Encode special characters for safe use in URLs, or decode percent-encoded strings back to readable text. Handles full URLs, query strings, and individual components.

https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den%26page%3D1

Parsed query parameters

KeyValue
qhello world
langen
page1

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI preserves characters that are valid in a URL (: / ? # @ etc.) — use for full URLs. encodeURIComponent encodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ) — use for individual query parameter values.

Why are spaces sometimes encoded as + vs %20?

application/x-www-form-urlencoded (HTML forms) uses + for spaces. encodeURIComponent uses %20. Both decode to a space, but %20 is the correct encoding in URLs and modern APIs.

Why does my URL look different after encoding?

Characters outside the ASCII safe set (spaces, unicode, special chars like &, =, ?) get percent-encoded. For example, a space becomes %20, & becomes %26. This ensures the URL is unambiguous and safe to transmit.