URL Encode
Percent-encode a URL component online using encodeURIComponent, with UTF-8 characters converted to safe percent-encoded bytes. Read more
What is URL encoding?
URL encoding, also called percent-encoding, represents bytes as a percent sign followed by two hexadecimal digits. For example, a space becomes %20. It allows characters that are not permitted literally, or that would otherwise act as delimiters, to be carried safely inside a URL component.
This tool uses JavaScript encodeURIComponent. It is intended for an individual component such as a query value, path value, or fragment value—not for encoding an entire URL containing structural delimiters.
How to encode a URL component
Enter the unencoded value and select Encode. For example:
hello worldbecomeshello%20worldname=Jane Doebecomesname%3DJane%20Doe台北becomes%E5%8F%B0%E5%8C%97
Non-ASCII text is converted to UTF-8 bytes before those bytes are percent-encoded. The percent-encoding mechanism and URI reserved characters are defined by RFC 3986.
Encode components, not the complete URL
Characters such as :, /, ?, #, &, and = can define the structure of a URL. Encoding a complete URL with encodeURIComponent also encodes these delimiters and can make the result unsuitable for direct navigation.
Build or parse the URL first, then encode only data inserted into an individual component. For example, encode the value Jane Doe before placing it after name= rather than encoding the complete query string.
URL encoding FAQ
Is URL encoding the same as encryption?
No. Percent-encoded data is reversible and provides no confidentiality or authenticity.
Should a space become %20 or +?
This tool produces %20. A plus sign is commonly used for spaces by HTML form encoding (application/x-www-form-urlencoded), which is a related but different convention.
Can a value be encoded twice?
It can, but usually should not be. Encoding %20 again produces %2520 because the percent sign becomes %25. RFC 3986 advises against encoding or decoding the same string more than once.
How do I reverse the result?
Use the URL Decode tool to decode a valid percent-encoded component.