URL Encoder / Decoder
Encode and decode URLs and query strings. Paste a URL or string to percent-encode special characters for safe use in URLs, or decode a percent-encoded string back to readable text. Uses the browser's built-in encodeURIComponent and decodeURIComponent functions.
How to Use
URL Encoding Examples
URL encoding ensures that special characters in query parameters are transmitted correctly. Characters like spaces, ampersands, and equals signs have special meanings in URLs — they delimit parameters and values. When these characters appear inside a parameter value, they must be encoded so the browser and server can parse the URL correctly. This tool uses encodeURIComponent, which is the correct function for encoding individual parameter values rather than full URLs.
Frequently Asked Questions
What is URL encoding?
URL encoding (percent encoding) converts characters that are not allowed or have special meaning in URLs into a percent sign followed by two hexadecimal digits. For example, a space becomes %20 and an ampersand becomes %26. This ensures URLs can be transmitted correctly across the internet.
When should I URL encode a string?
Encode values when building query strings or URL parameters. If a parameter value contains spaces, ampersands, equals signs, or other special characters, those must be encoded first. Most programming languages provide built-in functions: encodeURIComponent() in JavaScript, urllib.parse.quote() in Python, urlencode() in PHP.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a full URL and leaves characters like / : # ? & = intact because they form valid URL structure. encodeURIComponent encodes a parameter value and also encodes those structural characters, because inside a value they would break the URL. This tool uses encodeURIComponent, which is correct for encoding parameter values.
What does %20 mean in a URL?
%20 is the percent-encoded representation of a space character. The space character (ASCII code 32, hexadecimal 20) is not allowed in URLs directly, so it is encoded as %20. You may also see a + used to represent a space in query strings, which is an older convention from HTML form encoding.
Is my data sent to a server?
No. All encoding and decoding uses the browser's built-in JavaScript functions. Your text is never uploaded, stored, or sent to any server.