Encode special characters for safe URL use or decode percent-encoded URLs. Instant, browser-based, no sign-up.
URL encoding (percent-encoding) converts characters not allowed in URLs into a format that can be transmitted safely. Special characters like spaces, &, =, ?, # are replaced with a % sign followed by their hexadecimal code. For example, a space becomes %20.
Every major programming language has built-in URL encoding functions. In JavaScript, use encodeURIComponent() for query parameter values or encodeURI() for full URLs. In Python, use urllib.parse.quote(). In PHP, use urlencode() for form data or rawurlencode() for path segments.
%20 (or + in form data)%21%23%24%26%2B%2F%3A%3D%3F%40The unreserved characters A–Z, a–z, 0–9, hyphen (-), underscore (_), period (.), and tilde (~) should never be encoded. Encoding these characters unnecessarily can cause issues with some servers and is considered incorrect practice according to RFC 3986.