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 Encoder

URL 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.

URL Encoder — URL breakdown
Paste a URL to see its host, path and every query parameter decoded.

Real test: the same value in JavaScript, PHP and Python

Real test

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)*~
FunctionOutput
JavaScript encodeURIComponentTom%20%26%20Jerry%20%3D%20100%25%20fun%3F%2F%C3%BCn%C3%AF%20%231%20'q'%20(yes)*~
JavaScript encodeURITom%20&%20Jerry%20=%20100%25%20fun?/%C3%BCn%C3%AF%20#1%20'q'%20(yes)*~
JavaScript URLSearchParamsq=Tom+%26+Jerry+%3D+100%25+fun%3F%2F%C3%BCn%C3%AF+%231+%27q%27+%28yes%29*%7E
PHP urlencodeTom+%26+Jerry+%3D+100%25+fun%3F%2F%C3%BCn%C3%AF+%231+%27q%27+%28yes%29%2A%7E
PHP rawurlencodeTom%20%26%20Jerry%20%3D%20100%25%20fun%3F%2F%C3%BCn%C3%AF%20%231%20%27q%27%20%28yes%29%2A~
Python quoteTom%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_plusTom+%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:

Matching the tool to your code

Tool settingSame as
ComponentJavaScript encodeURIComponent
Component + Strict RFC 3986PHP rawurlencode; also encodes ! ' ( ) * (tested: a!~'()*.-_b → a%21~%27%28%29%2A.-_b in both)
Full URIJavaScript encodeURI
Form dataHTML 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

TaskJavaScriptPHPPython
Encode a query valueencodeURIComponent(v)rawurlencode($v)quote(v, safe="")
Build a whole query stringnew URLSearchParams(obj)http_build_query($arr)urlencode(dict)
Encode a path segmentencodeURIComponent(seg)rawurlencode($seg)quote(seg, safe="")
Decode a valuedecodeURIComponent(v)rawurldecode($v)unquote(v)

Python functions are in urllib.parse.

Debug with the tool

  1. Open the URL Encoder.
  2. Pick the mode that matches the function in your code (table above).
  3. Encode the raw value and compare it character by character with your code's output.
  4. 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.

// For AI & LLMs

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.

Last updated: