How to Use the URL Encoder
- Type or paste the text you want to encode.
- The URL-encoded result appears instantly.
- Copy the result to use safely inside a URL or query string.
What is URL/percent encoding?
Percent encoding replaces unsafe or reserved characters with a "%" followed by their two-digit hexadecimal ASCII (or UTF-8 byte) value. For example, a space becomes `%20` and an ampersand becomes `%26`. This lets any text be safely embedded inside a URL without breaking its structure.
Reserved characters
Certain characters have special meaning in a URL's structure — `&` separates query parameters, `=` separates a key from its value, `?` starts the query string, `/` separates path segments, and `#` starts a fragment. When any of these characters need to appear as literal data rather than structural punctuation (for example, an email address containing "@" in a query parameter), they must be percent-encoded.
Common use cases
URL encoding is essential when building query strings dynamically, passing user-generated text as a URL parameter, embedding a full URL inside another URL (like a redirect parameter), or including non-ASCII characters such as accented letters or emoji in a URL.
Example
hello world & more
hello%20world%20%26%20more
Tips
- Spaces are encoded as %20 (or sometimes "+", depending on context — query strings traditionally use "+").
- Encode each value individually before assembling a full query string, not the whole URL at once.
Frequently Asked Questions
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent escapes nearly all reserved characters and is meant for encoding an individual value (like a query parameter). encodeURI is meant for encoding a full URL and leaves structural characters like "/" and "?" untouched. This tool behaves like encodeURIComponent, suited for individual values.
Why does a space become %20?
%20 is the percent-encoded form of the space character's ASCII code (32 in hex is 20).