Learn why URL encoding is needed, how to encode special characters for safe use in URLs, and how to decode percent-encoded strings.
Guide étape par étape
Understand URL encoding
URLs can only contain a limited set of ASCII characters. Special characters (spaces, &, =, #, etc.) must be percent-encoded: replaced with % followed by a two-digit hex code. Example: space → %20, & → %26.
Encode a URL with our tool
Paste your string into the URL Encoder. Click Encode to convert all special characters to their percent-encoded equivalents. The result is safe to use in URLs.
Decode a URL-encoded string
Paste a percent-encoded string and click Decode to see the original text. Useful when you receive a garbled URL from a log, API response, or web form.
Encode only the query value, not the full URL
If building a URL like https://example.com/search?q=hello world, encode only the value: q=hello%20world. Encoding the full URL would also encode ://, ?, and =, breaking the structure.
encodeURIComponent vs encodeURI in JavaScript
encodeURIComponent encodes everything except unreserved chars (A-Z, a-z, 0-9, -, _, ., ~). Use it for query values. encodeURI skips URL structure chars (:, /, ?, #). Use it for full URLs.
Essayer notre outil gratuit
URL Encoder/Decoder
Questions fréquentes
Q: What is the difference between %20 and +?
A: Both represent a space, but in different contexts. %20 is standard percent-encoding for spaces in any URL part. + is used for spaces in HTML form query strings (application/x-www-form-urlencoded). Most modern decoders handle both.
Q: Why do URLs show %3A or %2F?
A: %3A = colon (:), %2F = forward slash (/). These appear when characters with URL-structural meaning are included in a query parameter value and need to be escaped.
Q: Do I need to encode the path too?
A: Path segments should encode spaces and other non-ASCII characters, but not the slashes (/) separating segments. Use encodeURIComponent on each path segment individually.