urlencode
URL-encode strings for query parameters, path segments, or form submissions. Decode percent-encoded strings back to readable text. Runs entirely in the browser — no server.
component mode
encodeURIComponent — for query values and path segments.
full URL mode
encodeURI — encodes a complete URL, preserving structural characters.
decode
Convert %xx sequences back to readable text. Handles + as space.
Component vs full URL.
encodeURIComponent
Encodes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ). Safe for individual query parameter values, path segments, and fragment identifiers. This is the right choice 95% of the time when you're encoding a value that will be embedded in a URL.
hello world & co → hello%20world%20%26%20co
encodeURI
Also leaves ; , / ? : @ & = + $ # unencoded — these are structural URL characters. Use this only when encoding a complete URL that already has its structure in place and you just need to handle non-ASCII or illegal characters.
https://example.com/path?q=héllo → https://example.com/path?q=h%C3%A9llo
Common questions.
What is %20 vs +?
%20 is the standard percent-encoded space used in path segments. + represents a space in application/x-www-form-urlencoded form data (HTML form submissions). Enable the + for spaces toggle to use the form-data convention.
Why can't I paste my full URL and get a clean encoded version?
Use full URL mode for complete URLs — it preserves ://?&=# and only encodes characters that are truly illegal in URLs. If you encode a full URL with component mode, the structural characters like :// get encoded and break the URL.
Does this work for non-English text?
Yes. Non-ASCII characters (Chinese, Arabic, emoji, accented letters) are first UTF-8-encoded, then each byte is percent-encoded. The result is a valid, interoperable URL component that works in all modern browsers and servers.
Is my data sent to a server?
No. Everything runs in your browser using the native encodeURIComponent and decodeURIComponent JavaScript functions. No network request is made.