URL Encode and Decode Tool
URL Encode and Decode
URL encoding (also called percent-encoding) converts characters that are not allowed in URLs into a safe format. Each unsafe character is replaced by a % sign followed by its two-digit hexadecimal code. For example, a space becomes %20, and & becomes %26. This ensures the URL transmits correctly over the web without being misinterpreted by servers, proxies, or browsers.
This tool encodes or decodes in both directions: paste a plain string in the left panel to get its percent-encoded form, or paste an encoded URL in the right panel to decode it back to readable text. For building URLs with tracking parameters, pair this with the UTM generator.
Which characters get URL-encoded?
| Character type | Examples | Encoded form |
|---|---|---|
| Unreserved (never encoded) | A-Z, a-z, 0-9, -, _, ., ~ | Passed through unchanged |
| Reserved (encoded when used as data) | :, /, ?, #, &, =, + | %3A, %2F, %3F, %23, %26, %3D, %2B |
| Space | (space character) | %20 (or + in application/x-www-form-urlencoded) |
| Common symbols | @, #, %, ^ | %40, %23, %25, %5E |
| Non-ASCII characters | accented letters, currency symbols, CJK characters | Multi-byte UTF-8 sequences, e.g. %C3%A9 for the letter e with acute accent |
What is the difference between encodeURI and encodeURIComponent?
JavaScript provides two encoding functions with different scope:
encodeURI()encodes a full URL, leaving reserved characters (:,/,?,#,&,=) intact because they have structural meaning in a URLencodeURIComponent()encodes a value intended for use within a URL component (e.g. a query string parameter value), encoding reserved characters as well
This tool behaves like encodeURIComponent: it encodes all characters except unreserved ones. Use this when encoding individual parameter values. If you are encoding a full URL, be aware that slashes and question marks will be encoded and the result will not be a valid URL.
Common URL encoding examples
| Original | Encoded | Context |
|---|---|---|
hello world | hello%20world | Space in query string |
user@example.com | user%40example.com | Email address as URL parameter |
price=10.99 | price%3D10.99 | Value containing equals sign |
https://mysite.com/page | https%3A%2F%2Fmysite.com%2Fpage | URL as a parameter value |
What is the difference between %20 and + for spaces?
Both represent a space, but in different contexts. %20 is the correct percent-encoding for a space in any part of a URL. + represents a space only in application/x-www-form-urlencoded format (the encoding used when an HTML form is submitted). In query strings submitted via forms, servers decode + as a space. In all other URL contexts, use %20.
Why does my encoded URL have %2F where I expect a slash?
This tool encodes all special characters including forward slashes. If you are encoding a full URL (including the path), use a tool that encodes only the query string parameters and leaves path slashes intact. If you are encoding a URL that appears as a value inside another URL's query string, %2F is correct.
What is double encoding and why is it a problem?
Double encoding happens when an already-encoded string is encoded again: %20 becomes %2520 (the % itself gets encoded as %25). This causes servers to receive the wrong value. Always decode before re-encoding if you are unsure whether your input is already encoded.
Related encoding and URL tools
- Base64 Encoder/Decoder - Convert between Base64 and plain text
- Hex to Text Converter - Convert between hexadecimal and text
- JSON Stringify - Escape text for use inside JSON strings
- HTML Formatter - Format and beautify HTML
- UTM Builder - Build URLs with campaign tracking parameters
Last reviewed: April 2026