URL Encode
Type or paste text and get the URL-encoded (percent-encoded) version. This tool escapes unsafe characters as %XX using encodeURIComponent or encodeURI — a space becomes %20, a slash %2F. Everything runs in your browser — nothing is uploaded.
How to URL-encode a string
Type or paste your text into the input above. The tool runs encodeURIComponent locally by default, escaping unsafe characters as %XX — a space becomes %20, a slash %2F, an ampersand %26. Switch the toggle to Full URI to use encodeURI instead, which preserves URL structure. Then click Copy.
encodeURIComponent vs encodeURI
The two functions differ in which characters they leave alone. encodeURIComponent escapes nearly everything reserved, so it is safe for a single query value or path segment. encodeURI deliberately leaves the URL-structure characters (/ ? : @ & = + $ , #) unescaped so a complete URL stays valid. Use component mode for values you drop into a query string; use full-URI mode to encode an entire URL that already has its structure.
| Character | encodeURIComponent | encodeURI |
|---|---|---|
| space | %20 | %20 |
/ | %2F | / (kept) |
? | %3F | ? (kept) |
& | %26 | & (kept) |
= | %3D | = (kept) |
# | %23 | # (kept) |
é (Unicode) | %C3%A9 | %C3%A9 |
Rule of thumb: reach for encodeURIComponent when encoding a query-parameter name or value, and encodeURI when encoding a whole URL you do not want to break.
Is this private?
Yes. The encoding runs fully in the browser with JavaScript — your text is encoded locally and nothing is uploaded to any server. You can confirm in DevTools → Network: encoding fires no request.
Frequently asked questions
How do I URL-encode text?
Paste your text into the input above. The tool runs encodeURIComponent (or encodeURI in Full URI mode) locally, escaping unsafe characters as %XX — a space becomes %20, a slash %2F. Then click Copy.
What's the difference between encodeURIComponent and encodeURI?
encodeURIComponent escapes almost everything that is not a letter, digit, or a few marks — including / ? : @ & = + $ # — so it is safe for a single value. encodeURI leaves those URL-structure characters intact because it is meant to encode a complete URL without breaking it.
Which one should I use for query parameters?
Use encodeURIComponent (the Component mode) for individual query-parameter names and values. It escapes & = ? and other reserved characters that would otherwise change the meaning of the query string.
Does this handle Unicode?
Yes. Both functions encode non-ASCII characters as their UTF-8 bytes in percent form — for example é becomes %C3%A9 and an emoji becomes several %XX bytes.
Need plain Base64 encode/decode?
The main base64.dev tool handles text, files, and URL-safe mode with auto-detect.
Open base64.dev →