$ encode --url

url encoder / decoder.

Encode or decode URL strings instantly. 100% client-side, no data leaves your browser.

input
1
2
3
4
5
0 / ∞ chars
output
URL encoding converts special characters into a format that can be transmitted over the internet. Spaces become %20, reserved characters like & and = get encoded to %26 and %3D respectively.
Use encodeURI for a full URL (preserves scheme, host, path). Use encodeURIComponent for query parameter values — it encodes everything including / and ?.
That is JSON encoded into URL-safe format. This happens when objects are serialized into query strings without proper encoding.

Common URL Encoded Characters

CharacterEncodedName
%20Space
!%21Exclamation mark
#%23Number sign
$%24Dollar sign
&%26Ampersand
'%27Single quote
(%28Left parenthesis
)%29Right parenthesis
*%2AAsterisk
+%2BPlus sign
/%2FSlash
:%3AColon
=%3DEquals sign
?%3FQuestion mark
@%40At sign

encodeURI vs encodeURIComponent

JavaScript provides two encoding functions — using the wrong one is a common bug:

// encodeURI — for full URLs (preserves : / ? & = #)
encodeURI("https://example.com/path?q=hello&lang=en")
// → "https://example.com/path?q=hello&lang=en"

// encodeURIComponent — for individual values (encodes everything)
encodeURIComponent("hello world&foo=bar")
// → "hello%20world%26foo%3Dbar"

Rule of thumb: Encoding a query parameter value? Always use encodeURIComponent. Building a full URL? Use encodeURI.

When You Need URL Encoding

URL encoding appears in more places than you might expect:

learn more in our detailed guide.

→ read the guide