URL encoding (also called percent encoding) is the process of converting characters that are not allowed in URLs into a format that can be safely transmitted. URLs can only contain a limited set of characters from the ASCII character set. Characters like spaces, ampersands, question marks, and non-ASCII characters must be percent-encoded to be included in a URL.
For example, a space character is encoded as %20, an ampersand becomes %26, and a question mark becomes %3F. Unicode characters like accented letters or Asian scripts are first converted to their UTF-8 byte representation, and then each byte is percent-encoded. The character "cafe" with an accent on the e would be encoded as "caf%C3%A9".
URL encoding is essential when building query strings, submitting form data, constructing API requests, or embedding user-generated content in URLs. Failing to properly encode special characters can cause broken links, incorrect data transmission, and security vulnerabilities like injection attacks. Always encode user input before including it in a URL to ensure both functionality and security.
Characters outside the unreserved set (A-Z, a-z, 0-9, hyphen, underscore, period, tilde) should be encoded when used in URL components. This includes spaces (%20), ampersands (%26), equals signs (%3D), question marks (%3F), and all non-ASCII characters like accented letters and emojis.
encodeURI encodes a complete URI but preserves characters that have special meaning in URLs (like /, ?, #, &). encodeURIComponent encodes everything except unreserved characters, making it suitable for encoding individual query parameter values. This tool uses encodeURIComponent, which is the safer choice for most use cases.
You can, but be careful. If you encode an entire URL, characters like :// and / in the path will also be encoded, which may break the URL structure. This tool is best used for encoding individual query parameter values or text fragments that will be inserted into a URL, not the full URL itself.
No. URL encoding (percent encoding) converts individual characters to their %XX hexadecimal representation and is specifically designed for URLs. Base64 encoding converts binary data to an ASCII string using a 64-character alphabet. They serve different purposes and are not interchangeable.
No. All encoding and decoding happens entirely in your browser using JavaScript's built-in encodeURIComponent and decodeURIComponent functions. Your text and URLs never leave your device, making this tool safe for encoding sensitive data like API keys or authentication tokens.