%url-decoder.net

URL encoding functions compared

The same character is encoded differently depending on the function you call. This page shows what each one actually outputs, taken from running the code rather than from documentation.

Short answer

To encode one value for a URL, JavaScript's encodeURIComponent, Python's quote(s, safe='') and C#'s Uri.EscapeDataString give the same output except for ! ' ( ) *. Functions that write a space as + (URLSearchParams, quote_plus, WebUtility.UrlEncode and HttpUtility.UrlEncode) follow form-encoding rules and are not interchangeable with them in a URL path.

Where the functions differ

Each statement below is generated from the results in the table.

Space: %20 or +
encodeURIComponent, encodeURI, escape (deprecated), quote, quote (safe='') and Uri.EscapeDataString write a space as %20. URLSearchParams, quote_plus, WebUtility.UrlEncode and HttpUtility.UrlEncode write it as +, the form-encoding convention. Pick by what the receiver expects: %20 is valid in paths and queries; + only means a space in form-encoded data.
Slash
Only encodeURI, escape (deprecated) and quote leave / unencoded. Python's quote does it because its default is safe='/'; pass safe='' to encode it. See %2F.
The characters ! ' ( ) * ~
Of the three functions that encode a single value, encodeURIComponent, quote (safe='') and Uri.EscapeDataString, the only characters they disagree on are ! ' ( ) *: encodeURIComponent keeps them, the other two encode them. Strict RFC 3986 output needs those five escaped. * is kept by encodeURIComponent, encodeURI, URLSearchParams, escape (deprecated), WebUtility.UrlEncode and HttpUtility.UrlEncode. The tilde is encoded as %7E by URLSearchParams, escape (deprecated), WebUtility.UrlEncode and HttpUtility.UrlEncode.
Plus sign
encodeURI and escape (deprecated) leave + unencoded, so a literal plus inside a value is later read as a space by form-style parsers. See %2B.
Hex case
HttpUtility.UrlEncode writes hex digits in lower case (%c3%a9). Every other function writes upper case. Both decode identically; RFC 3986 recommends upper case.
Non-standard output
escape (deprecated) encodes characters above U+00FF as %uXXXX, which is not valid percent-encoding and which servers do not understand. It is deprecated; use encodeURIComponent.

Single characters

“Kept” means the function leaves the character unchanged. The character guides explain what goes wrong with the common ones.

Output of each URL-encoding function for single characters
InputJavaScriptPythonC#
encodeURIComponentencodeURIURLSearchParamsescape (deprecated)quote (default safe='/')quote (safe='')quote_plusUri.EscapeDataStringWebUtility.UrlEncodeHttpUtility.UrlEncode
space%20%20+%20%20%20+%20++
!keptkept%21%21%21%21%21%21keptkept
"%22%22%22%22%22%22%22%22%22%22
#%23kept%23%23%23%23%23%23%23%23
$%24kept%24%24%24%24%24%24%24%24
%%25%25%25%25%25%25%25%25%25%25
&%26kept%26%26%26%26%26%26%26%26
'keptkept%27%27%27%27%27%27%27%27
(keptkept%28%28%28%28%28%28keptkept
)keptkept%29%29%29%29%29%29keptkept
*keptkeptkeptkept%2A%2A%2A%2Akeptkept
+%2Bkept%2Bkept%2B%2B%2B%2B%2B%2b
,%2Ckept%2C%2C%2C%2C%2C%2C%2C%2c
-keptkeptkeptkeptkeptkeptkeptkeptkeptkept
.keptkeptkeptkeptkeptkeptkeptkeptkeptkept
/%2Fkept%2Fkeptkept%2F%2F%2F%2F%2f
:%3Akept%3A%3A%3A%3A%3A%3A%3A%3a
;%3Bkept%3B%3B%3B%3B%3B%3B%3B%3b
<%3C%3C%3C%3C%3C%3C%3C%3C%3C%3c
=%3Dkept%3D%3D%3D%3D%3D%3D%3D%3d
>%3E%3E%3E%3E%3E%3E%3E%3E%3E%3e
?%3Fkept%3F%3F%3F%3F%3F%3F%3F%3f
@%40kept%40kept%40%40%40%40%40%40
[%5B%5B%5B%5B%5B%5B%5B%5B%5B%5b
\%5C%5C%5C%5C%5C%5C%5C%5C%5C%5c
]%5D%5D%5D%5D%5D%5D%5D%5D%5D%5d
^%5E%5E%5E%5E%5E%5E%5E%5E%5E%5e
_keptkeptkeptkeptkeptkeptkeptkeptkeptkept
`%60%60%60%60%60%60%60%60%60%60
{%7B%7B%7B%7B%7B%7B%7B%7B%7B%7b
|%7C%7C%7C%7C%7C%7C%7C%7C%7C%7c
}%7D%7D%7D%7D%7D%7D%7D%7D%7D%7d
~keptkept%7E%7Ekeptkeptkeptkept%7E%7e
é%C3%A9%C3%A9%C3%A9%E9%C3%A9%C3%A9%C3%A9%C3%A9%C3%A9%c3%a9
€%E2%82%AC%E2%82%AC%E2%82%AC%u20AC%E2%82%AC%E2%82%AC%E2%82%AC%E2%82%AC%E2%82%AC%e2%82%ac
日%E6%97%A5%E6%97%A5%E6%97%A5%u65E5%E6%97%A5%E6%97%A5%E6%97%A5%E6%97%A5%E6%97%A5%e6%97%a5
😀%F0%9F%98%80%F0%9F%98%80%F0%9F%98%80%uD83D%uDE00%F0%9F%98%80%F0%9F%98%80%F0%9F%98%80%F0%9F%98%80%F0%9F%98%80%f0%9f%98%80

Whole strings

Output of each URL-encoding function for whole strings
InputJavaScriptPythonC#
encodeURIComponentencodeURIURLSearchParamsescape (deprecated)quote (default safe='/')quote (safe='')quote_plusUri.EscapeDataStringWebUtility.UrlEncodeHttpUtility.UrlEncode
a ba%20ba%20ba+ba%20ba%20ba%20ba+ba%20ba+ba+b
a+ba%2Bbkepta%2Bbkepta%2Bba%2Bba%2Bba%2Bba%2Bba%2bb
café au laitcaf%C3%A9%20au%20laitcaf%C3%A9%20au%20laitcaf%C3%A9+au+laitcaf%E9%20au%20laitcaf%C3%A9%20au%20laitcaf%C3%A9%20au%20laitcaf%C3%A9+au+laitcaf%C3%A9%20au%20laitcaf%C3%A9+au+laitcaf%c3%a9+au+lait
100% sure100%25%20sure100%25%20sure100%25+sure100%25%20sure100%25%20sure100%25%20sure100%25+sure100%25%20sure100%25+sure100%25+sure
a b&c=d/éa%20b%26c%3Dd%2F%C3%A9a%20b&c=d/%C3%A9a+b%26c%3Dd%2F%C3%A9a%20b%26c%3Dd/%E9a%20b%26c%3Dd/%C3%A9a%20b%26c%3Dd%2F%C3%A9a+b%26c%3Dd%2F%C3%A9a%20b%26c%3Dd%2F%C3%A9a+b%26c%3Dd%2F%C3%A9a+b%26c%3dd%2f%c3%a9
https://example.com/a b?q=1&r=é#tophttps%3A%2F%2Fexample.com%2Fa%20b%3Fq%3D1%26r%3D%C3%A9%23tophttps://example.com/a%20b?q=1&r=%C3%A9#tophttps%3A%2F%2Fexample.com%2Fa+b%3Fq%3D1%26r%3D%C3%A9%23tophttps%3A//example.com/a%20b%3Fq%3D1%26r%3D%E9%23tophttps%3A//example.com/a%20b%3Fq%3D1%26r%3D%C3%A9%23tophttps%3A%2F%2Fexample.com%2Fa%20b%3Fq%3D1%26r%3D%C3%A9%23tophttps%3A%2F%2Fexample.com%2Fa+b%3Fq%3D1%26r%3D%C3%A9%23tophttps%3A%2F%2Fexample.com%2Fa%20b%3Fq%3D1%26r%3D%C3%A9%23tophttps%3A%2F%2Fexample.com%2Fa+b%3Fq%3D1%26r%3D%C3%A9%23tophttps%3a%2f%2fexample.com%2fa+b%3fq%3d1%26r%3d%c3%a9%23top

How this was made

Every value in the tables was produced by running the function on the input, using these runtimes:

  • JavaScript: Node.js 18.20.7 (V8 10.2.154.26-node.39), run on 2026-11-04
  • Python: Python 3.12.6, run on 2026-11-04
  • C#: .NET 8.0.6, run on 2026-11-04

Java, PHP and Go are not in the tables yet because their runtimes have not been run for this page. They will be added as generated results, not copied from documentation. Results can differ between versions of a runtime, so treat the version above as part of the answer. The data is free to reuse under CC BY 4.0 with a link back: download as JSON.

Try a value yourself

Choose component, full-URL or form rules, with strict RFC 3986 and +/%20 options.

Open the URL Encoder

Behaviour checked against RFC 3986, the WHATWG URL Standard and MDN. Updated November 4, 2026