URL Encoder & Decoder
Encode query parameters and strings to percent-encoded URI notation, or decode escaped URLs. Fast, secure and browser-based.
What is URL Encoding (Percent Encoding)?
URL encoding (officially called percent-encoding) is a method to encode data within a Uniform Resource Identifier (URI) so that web servers and browsers can parse parameter strings correctly. URIs can only contain a limited set of ASCII characters. If you need to include spaces, emojis, query dividers, or letters from non-Latin scripts, they must be converted.
The conversion maps non-conforming characters to their hexadecimal value preceded by a `%` character. For example, a blank space becomes `%20`, a question mark becomes `%3F`, and an ampersand becomes `%26`.
Encode URI vs. Encode URI Component
JavaScript provides two primary APIs to encode URLs:
- Encode Parameter (encodeURIComponent): This functions encodes *every* non-standard character, including `/`, `?`, `:`, `@`, and `&`. This is the correct choice when you are encoding a string that will become a value of a query parameter inside a larger URL address.
- Encode Full URL (encodeURI): This method leaves structural delimiters like protocol schemes (`http://`, `https://`), slashes, and question marks intact. It only encodes symbols that cannot exist in a valid URL, such as blank spaces, quotes, or emojis. Use this when you have a complete URL path and want to ensure it is validly formatted.
Frequently Asked Questions
URL encoding is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. It replaces unsafe ASCII characters with a '%' followed by two hexadecimal digits representing the character code. It is used to ensure URL parameters are parsed correctly by web servers.
Encoding a component (encodeURIComponent) encodes all special characters, including protocol delimiters like '://', '/' and '?'. This is used when passing a complete URL as a parameter inside another URL. Encoding a full URL (encodeURI) leaves delimiters like 'http://', '/' and '?' intact, formatting only spaces and other invalid characters to keep the URL address functional.
No. Like all tools on our site, the URL encoding and decoding operations happen inside your browser using standard JavaScript APIs. No database logs are created.