URL Encoder / Decoder
Percent-encode or decode URLs. URL encoding converts special characters into a format that can be safely transmitted in a URI, replacing reserved characters with %-prefixed hex values.
Frequently Asked Questions
What is URL encoding?
URL encoding (also called percent-encoding) is a mechanism for encoding special characters in a URI. Reserved characters like spaces, ampersands, and question marks are replaced with a % followed by their two-digit hexadecimal value. For example, a space becomes %20.
When should I URL-encode a string?
You should URL-encode strings when passing data as query parameters, form data (application/x-www-form-urlencoded), path segments containing special characters, or when building URLs programmatically that may include user input.
What characters need to be URL-encoded?
Reserved characters that must be encoded include: space, !, #, $, &, ', (, ), *, +, ,, /, :, ;, =, ?, @, [, and ]. Unreserved characters (A–Z, a–z, 0–9, -, _, ., ~) do not need encoding.
What is the difference between encodeURI and encodeURIComponent?
encodeURI() encodes a full URI and preserves characters that have special meaning (like :, /, ?, #, &). encodeURIComponent() encodes everything except unreserved characters, making it suitable for encoding individual query parameter values.