Encode special characters for safe URL usage or decode percent-encoded URL strings back to readable text.
URL encoding (also known as percent-encoding) is a mechanism for converting special characters into a format that can be safely transmitted over the internet. Characters like spaces, ampersands, question marks, and non-ASCII characters are replaced with a percent sign followed by two hexadecimal digits. There are two main types: encodeURI for full URLs (preserving URL structure characters like /, ?, &) and encodeURIComponent for individual URL parameter values (encoding all special characters).
Enter your text or URL in the input field. Click "Encode URL" to safely encode a full URL while preserving its structure. Click "Encode Component" to encode individual parameter values (more aggressive encoding). To decode, paste a percent-encoded string and click "Decode URL" to see the original text.
Our URL encoder is essential for web developers building query strings, API requests, or handling user input in URLs. It handles all edge cases correctly and runs entirely in your browser. No data is uploaded to any server, ensuring complete privacy. Perfect for debugging encoded URLs, constructing safe links, or understanding percent-encoded data.
URL encoding is a fundamental skill for anyone working with the web. Here are the most common practical scenarios where this tool is essential:
?q=cats%20%26%20dogs. This tool lets you encode each parameter value safely.application/x-www-form-urlencoded) when submitted via GET or POST. Understanding how form data is encoded helps when debugging form submissions or building server-side handlers.encodeURIComponent ensures your API calls are correctly formed and not rejected by the server.encodeURI encodes a full URI while preserving characters that are part of the URI syntax (/, ?, &, #). Use this for encoding entire URLs. encodeURIComponent encodes everything, including those characters — use this for individual query parameter values. Using the wrong one is a common source of bugs.%20. Some older implementations use + for spaces in query strings (application/x-www-form-urlencoded), but %20 is the standard and works everywhere including path segments.%20 or %26 looks unprofessional and confuses users.% signs get encoded to %25, producing %2520 instead of %20. Only encode the original unencoded value, not an already-encoded string.| Character | Encoded Form | Common Context |
|---|---|---|
| Space | %20 | Query strings, path segments |
| ! Exclamation mark | %21 | Path segments, parameter values |
| # Hash | %23 | Fragment identifiers |
| $ Dollar sign | %24 | Parameter values |
| % Percent | %25 | Already-encoded values |
| & Ampersand | %26 | Query parameter separators |
| + Plus | %2B | Parameter values, form data |
| / Slash | %2F | Path segments (when not a separator) |
| = Equals | %3D | Key-value pairs in query strings |
| ? Question mark | %3F | Query string start |
URL encoding (percent-encoding) converts characters for safe transmission in URLs by replacing them with % followed by two hexadecimal digits. HTML encoding uses named or numeric character entities like & to display reserved characters in HTML content. They serve different purposes and should not be confused.
Use encodeURI when you have a complete URL string and want to encode special characters while keeping the URL functional (it preserves /, ?, &, #). Use encodeURIComponent when encoding individual query parameter values — it encodes all special characters, ensuring the value does not break the URL structure.
Common reasons include double encoding (encoding an already-encoded string), using encodeURI instead of encodeURIComponent for parameter values, or forgetting to encode the value at all. Try decoding your URL fully first, then encode each component separately using the appropriate method.
Yes. URL encoding converts non-ASCII characters to their UTF-8 byte sequences and then percent-encodes each byte. For example, the Euro sign (EUR) encodes to %E2%82%AC. This tool handles Unicode characters correctly on both encode and decode operations.