URL Encoder / Decoder for Developers
Encode and decode URLs while you build and debug, and see how the result compares to JavaScript, PHP and Python functions. Free, in your browser.
Open the URL EncoderURL encoding looks standard until two systems disagree on one character and a request, a signature or a redirect fails. JavaScript, PHP and Python each have several functions, and they do not all produce the same output.
Below is one value run through eight real functions, the differences that cause bugs, how the tool's modes map to them, and recipes for common tasks.

Real test: the same value in JavaScript, PHP and Python
One value encoded with the standard functions of three languages (Node.js, PHP 8.3, Python 3), run by us.
Value
Tom & Jerry = 100% fun?/ünï #1 'q' (yes)*~
| Function | Output |
|---|---|
| JavaScript encodeURIComponent | Tom%20%26%20Jerry%20%3D%20100%25%20fun%3F%2F%C3%BCn%C3%AF%20%231%20'q'%20(yes)*~ |
| JavaScript encodeURI | Tom%20&%20Jerry%20=%20100%25%20fun?/%C3%BCn%C3%AF%20#1%20'q'%20(yes)*~ |
| JavaScript URLSearchParams | q=Tom+%26+Jerry+%3D+100%25+fun%3F%2F%C3%BCn%C3%AF+%231+%27q%27+%28yes%29*%7E |
| PHP urlencode | Tom+%26+Jerry+%3D+100%25+fun%3F%2F%C3%BCn%C3%AF+%231+%27q%27+%28yes%29%2A%7E |
| PHP rawurlencode | Tom%20%26%20Jerry%20%3D%20100%25%20fun%3F%2F%C3%BCn%C3%AF%20%231%20%27q%27%20%28yes%29%2A~ |
| Python quote | Tom%20%26%20Jerry%20%3D%20100%25%20fun%3F/%C3%BCn%C3%AF%20%231%20%27q%27%20%28yes%29%2A~ |
| Python quote(safe="") | Tom%20%26%20Jerry%20%3D%20100%25%20fun%3F%2F%C3%BCn%C3%AF%20%231%20%27q%27%20%28yes%29%2A~ |
| Python quote_plus | Tom+%26+Jerry+%3D+100%25+fun%3F%2F%C3%BCn%C3%AF+%231+%27q%27+%28yes%29%2A~ |
Eight functions, seven different results. The differences that bite in practice:
- Python
quote()keeps / by default. Fine for paths, wrong for values: "fun?/ünï" leaks a slash into the query. Passsafe=""for values. - Space as + or %20. PHP
urlencode, Pythonquote_plusandURLSearchParamsuse +, the HTML form style. The others use %20. Decode with the matching function. - ' ( ) * ~ are left alone by JavaScript's encodeURIComponent but encoded by PHP and Python (except ~). Usually harmless, but signatures (OAuth, AWS) require the strict RFC 3986 form.
- encodeURI is for whole URLs only: it left &, = and # unencoded, so the value broke the query.
Matching the tool to your code
| Tool setting | Same as |
|---|---|
| Component | JavaScript encodeURIComponent |
| Component + Strict RFC 3986 | PHP rawurlencode; also encodes ! ' ( ) * (tested: a!~'()*.-_b → a%21~%27%28%29%2A.-_b in both) |
| Full URI | JavaScript encodeURI |
| Form data | HTML form encoding: space as +, like PHP urlencode and Python quote_plus |
Use the tool to reproduce what a client or server sends, and compare it with what your code produces. A mismatch in one character is enough to break a signature or a cache key.
Recipes
| Task | JavaScript | PHP | Python |
|---|---|---|---|
| Encode a query value | encodeURIComponent(v) | rawurlencode($v) | quote(v, safe="") |
| Build a whole query string | new URLSearchParams(obj) | http_build_query($arr) | urlencode(dict) |
| Encode a path segment | encodeURIComponent(seg) | rawurlencode($seg) | quote(seg, safe="") |
| Decode a value | decodeURIComponent(v) | rawurldecode($v) | unquote(v) |
Python functions are in urllib.parse.
Debug with the tool
- Open the URL Encoder.
- Pick the mode that matches the function in your code (table above).
- Encode the raw value and compare it character by character with your code's output.
- For lists, tick "Each line separately" to encode many test values at once.
Frequently asked questions
Which JavaScript function should I use for query values?
encodeURIComponent, or URLSearchParams to build the whole query. Never encodeURI for values.
What is the difference between urlencode and rawurlencode in PHP?
urlencode writes spaces as + (form style); rawurlencode writes %20 and follows RFC 3986.
Why does Python quote() not encode the slash?
Its default safe set is "/". Pass safe="" when encoding a value.
Does encodeURIComponent encode apostrophes and parentheses?
No. It leaves ' ( ) * ~ alone; use the strict RFC 3986 option or rawurlencode if you need them encoded.
Which tool mode matches PHP rawurlencode?
Component with Strict RFC 3986. In our test both gave the same output.
Is anything sent to a server?
No. The tool runs in your browser.
Last updated: 18 November 2026.
Real side-by-side test of URL encoding functions on one value: JavaScript encodeURIComponent, encodeURI, URLSearchParams; PHP urlencode, rawurlencode; Python quote, quote(safe=""), quote_plus. Results differ in space handling (+ vs %20), slash (Python quote keeps /) and ' ( ) * ~.
The All Innovativ URL Encoder's Component mode matches encodeURIComponent, Component + strict RFC 3986 matches PHP rawurlencode (a!~'()*.-_b → a%21~%27%28%29%2A.-_b), Full URI matches encodeURI and Form data matches HTML form encoding.