This URL encoder percent-encodes text for use in URLs, and its URL decoder turns percent-encoded strings back into readable text. The default mode uses JavaScript's encodeURIComponent, which escapes everything except ASCII letters, digits and - _ . ! ~ * ' ( ), and suits a single query value or path segment. Ticking "Encode full URL" switches to encodeURI, which also leaves : / ? & = # and the other URL delimiters alone. Both tabs update as you type, in your browser.
How to use the URL encoder and decoder
- On the Encode tab, paste text into Text or URL to Encode. Encoded Output fills in as you type, or press Encode.
- Tick Encode full URL if the input is a whole address whose slashes, question mark and ampersands must survive. Leave it unticked for a single value.
- Press Copy Encoded. The note beside it shows the length change, for example 12 chars to 18 chars for
fish & chips. - To decode, open the Decode tab, paste the string into URL-Encoded String to Decode, and copy the result with Copy Decoded.
Component or full URL: which characters change
| Character | Default mode | Encode full URL |
|---|---|---|
| space | %20 | %20 |
| & | %26 | & |
| / | %2F | / |
| ? | %3F | ? |
| = | %3D | = |
| # | %23 | # |
| + | %2B | + |
| % | %25 | %25 |
| é | %C3%A9 | %C3%A9 |
Each escape is a percent sign followed by the byte's value in hex. Non-ASCII text is encoded as UTF-8 bytes, so é becomes two escapes and café €5 becomes caf%C3%A9%20%E2%82%AC5.
Example: one query string in both modes
Input:
https://example.com/search?q=fish & chips
Default mode:
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dfish%20%26%20chips
Encode full URL ticked:
https://example.com/search?q=fish%20&%20chips
The default mode escaped the slashes and the question mark, so the result is no longer a usable address. Full URL mode left the ampersand alone, so a server reads q as "fish " plus a second, empty parameter named " chips". The component breakdown table under the output shows that split. Encode only the value instead: fish & chips becomes fish%20%26%20chips, which gives https://example.com/search?q=fish%20%26%20chips.
Common uses
Typical jobs are building query strings by hand, for an API request or a UTM-tagged link whose campaign name contains spaces or an ampersand, and reading redirect or tracking URLs that carry a second URL percent-encoded inside a parameter. To see where such a link finally lands, the redirect checker follows each hop from its server. For a readable path segment made from a page title, the URL slug generator strips punctuation and joins the words with a separator.
Percent-encoding is different from Base64. When an API wants binary data or a token inside a URL, it usually means base64url, which the Base64 tool produces with its URL-safe option, and the explainer on Base64 encoding covers how base64url differs from standard Base64. More tools of this kind are in the developer tools section.
URL encoding in code, compared with this URL encoder
The URL encoder's default mode gives the same result as these standard functions for most text. Java's URLEncoder is the odd one out, because it follows HTML form rules and writes a space as +:
JavaScript encodeURIComponent("fish & chips") fish%20%26%20chips
PHP rawurlencode("fish & chips") fish%20%26%20chips
Python urllib.parse.quote("fish & chips", safe="") fish%20%26%20chips
C# Uri.EscapeDataString("fish & chips") fish%20%26%20chips
Java URLEncoder.encode("fish & chips", UTF_8) fish+%26+chips
Python's quote() leaves slashes alone unless you pass safe="", so a/b c becomes a/b%20c by default. PHP's rawurlencode() also escapes ! * ' ( ), which this URL encoder leaves as they are.
Behaviour to watch for
- The decoder turns every
+into a space before decoding, as HTML forms do.C%2B%2B+tipsdecodes to "C++ tips", while an unencoded plus in1+1=2comes back as "1 1=2". - Full URL mode encodes the percent sign too, so an address that is already encoded gets encoded twice:
a%20bbecomesa%2520b. If in doubt, decode it first.