URL Encoder (Percent Encoding)
Example
Input:
name=Ali Raza&city=Faisalabad
Output:
name%3DAli%20Raza%26city%3DFaisalabad
About this converter
Percent-encoding (RFC 3986) replaces every byte that is not allowed in a URL with % followed by two hex digits of its UTF-8 value: a space is %20, an ampersand is %26, and the Urdu letter ب is %D8%A8. The two modes matter: encoding a component (a query value, a path segment) must escape everything structural, because a raw & or = inside a value would break the URL apart; encoding a full URL must preserve the structure and only escape characters that are invalid anywhere. A common bug is double-encoding — encoding an already-encoded string turns %20 into %2520. Note that in query strings, + is also used for a space (from HTML form encoding), which decoders on this site handle.
Frequently Asked Questions
Should I encode a space as %20 or +?
In a path, only %20 is correct. In a query string both are understood, with + coming from HTML form submission (application/x-www-form-urlencoded).
What characters never need encoding?
Letters, digits and - _ . ~ are unreserved and always safe. Everything else depends on where in the URL it appears.
Why did my URL break after encoding?
Usually double-encoding, or encoding the whole URL in component mode so its : / ? became %3A %2F %3F. Use full-URL mode for complete links.