URL Encode
Percent-encode any text for safe inclusion in URLs, query strings, and form data.
Example
Input text with spaces and special characters is percent-encoded:
Input: hello world & café=résumé
Output: hello%20world%20%26%20caf%C3%A9%3Dr%C3%A9sum%C3%A9
How it works
Type or paste text into the input and it is encoded live with encodeURIComponent. Click Copy to grab the result or Load sample to see an example.
Good to know
URL Encode percent-encodes any text you paste so it can be safely dropped into a URL, a query-string value, or an application/x-www-form-urlencoded form field. It runs JavaScript's encodeURIComponent in your browser as you type, converting spaces, reserved punctuation, and Unicode into %XX sequences. It's aimed at developers and anyone hand-building links, API requests, or tracking URLs who needs a value that won't break the surrounding URL syntax.
Reach for it whenever a piece of text has to become a single component inside a larger URL: a search term with spaces, an email address with an @ sign, a redirect target containing its own ?, &, and = characters, or an OAuth/UTM parameter that includes punctuation. Because it encodes one value at a time, it's the right choice for individual query-string values rather than for an already-complete URL where you want slashes and the leading scheme left alone.
To read the output, scan the result for percent sequences and remember each %XX is one byte: a space becomes %20, an ampersand %26, an equals sign %3D, and a multi-byte character such as é expands to two bytes (%C3%A9). The character count in the status line refers to the original input length, not the encoded length, so a short phrase can legitimately produce a much longer string once Unicode and symbols are expanded.
A practical caveat: this tool intentionally encodes the reserved characters that structure a URL, so don't run a whole address like https://site.com/a?b=c through it expecting a working link — the ://, /, ?, and = will all be escaped. Encode each value separately and assemble the URL afterward. Note too that a handful of characters (- _ . ! ~ * ' ( ) plus letters and digits) are left untouched by design, which is normal and still URL-safe.
Frequently asked questions
Does this encode every character, including slashes and ampersands?
It uses encodeURIComponent, which encodes nearly all reserved characters including / ? & = and spaces, so the result is safe to drop into a single query-string value. Only A-Z a-z 0-9 and - _ . ! ~ * ' ( ) are left untouched.
How are Unicode and emoji handled?
Non-ASCII characters are first converted to UTF-8 bytes and then percent-encoded, so accented letters, CJK text, and emoji all produce valid %XX sequences that decode back to the original.
Is my data uploaded anywhere?
No — this tool runs entirely in your browser. Your input never leaves your device and it works offline once loaded.
Is it free?
Yes, completely free with no sign-up and no limits.
People also ask
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent (used by this tool) escapes nearly all reserved characters and is meant for a single URL piece such as one query-string value. encodeURI is meant for a whole URL and deliberately leaves structural characters like / ? : & = unescaped so the address stays functional.
Why does a space become %20 instead of a plus sign?
In the path and generic query encoding that encodeURIComponent follows, a space is %20. The plus sign represents a space only in the older application/x-www-form-urlencoded form format, so you'd convert %20 to + manually if a form specifically requires it.
What characters does URL encoding leave unchanged?
The unreserved set is left as-is: A-Z, a-z, 0-9, and the symbols - _ . ! ~ * ' ( ). Everything else, including spaces, slashes, and most punctuation, is turned into percent-encoded bytes.
How do I reverse URL encoding to get the original text back?
Run the encoded string through a URL decoder, which applies decodeURIComponent to turn each %XX sequence back into its original character. The process is lossless, so decoding returns exactly what you started with.
Why is one accented or emoji character turned into several %XX codes?
Non-ASCII characters are first converted to their UTF-8 bytes, and each byte becomes one %XX. An accented letter is typically two bytes and many emoji are four, so a single visible character can produce multiple percent codes.
Do I need to URL-encode a value before putting it in a query string?
Yes, if the value contains spaces, &, =, ?, #, or non-ASCII characters, encoding prevents it from being misread as part of the URL's structure. Plain alphanumeric values without those characters can be used without changes.
Is it safe to URL-encode the same text twice?
Double-encoding changes the result because the percent signs from the first pass get encoded again (% becomes %25), producing strings like %2520 instead of %20. Encode a value only once, then decode once to recover it.
Related tools