Encode special characters for safe use in URLs or decode percent-encoded strings back to readable text. Handles UTF-8 characters, query parameters, and full URLs. All processing happens in your browser.
URL encoding (percent encoding) replaces unsafe characters in a URL with a percent sign followed by their hexadecimal byte values. For example, a space becomes %20, an ampersand becomes %26, and a forward slash becomes %2F. This ensures that special characters do not break the URL structure or get misinterpreted by web servers and browsers.
JavaScript provides two functions for URL encoding. encodeURI() encodes a full URL but preserves characters that are valid in URLs, such as :, /, ?, #, and &. encodeURIComponent() encodes everything except letters, digits, and - _ . ~, making it the right choice for encoding individual query parameter values. This tool provides both options.
| Character | Encoded | Description |
|---|---|---|
| (space) | %20 | Space character |
| & | %26 | Query parameter separator |
| = | %3D | Key-value delimiter |
| ? | %3F | Query string start |
| # | %23 | Fragment identifier |
| / | %2F | Path separator |
| @ | %40 | User info delimiter |
| + | %2B | Plus sign |
URL encoding (also called percent encoding) converts characters that are not allowed in URLs into a format that can be transmitted safely. You need it whenever you pass user input, special characters, or non-ASCII text in a URL. Common scenarios include building API query strings, encoding form data, passing file names with spaces in URLs, and working with internationalized domain names or paths containing characters like accents or emoji.
encodeURI encodes a complete URL while preserving characters that have special meaning in URLs, such as colons, slashes, question marks, and hash symbols. encodeURIComponent encodes a single URL component (like a query parameter value) and encodes all special characters including those preserved by encodeURI. Use encodeURI when you have a full URL that just needs non-ASCII characters encoded. Use encodeURIComponent when encoding a value that will be inserted into a query parameter, path segment, or fragment.
Both are valid in different contexts. %20 is the standard percent encoding for spaces defined in RFC 3986 and works everywhere in a URL including paths, query strings, and fragments. The plus sign (+) for spaces is specific to the application/x-www-form-urlencoded format used in HTML form submissions and some query strings. When building API requests or encoding path segments, use %20. When encoding HTML form data, either works, but %20 is the safer universal choice.
Yes. This URL encoder fully supports UTF-8 encoding. International characters such as accented letters, Chinese, Japanese, Korean, Arabic, emoji, and other Unicode characters are converted to their UTF-8 byte sequences and then percent-encoded. For example, the character "cafe" with an accented e becomes "caf%C3%A9". This is the correct behavior specified by RFC 3986 and matches how modern browsers handle international URLs.
Yes. This URL encoder and decoder runs entirely inside your browser using JavaScript. Your data never leaves your device. There are no server requests, no logging, and no data storage. You can verify this by monitoring the Network tab in your browser's developer tools. This makes it safe for encoding URLs containing API keys, tokens, passwords, and other sensitive parameters.