Input
Output
What This Tool Does
Percent-encodes URLs or individual URL components, converting unsafe characters to their %XX hex equivalents. Two encode modes are provided: Component (encodeURIComponent) for encoding values within a URL, and Full URI (encodeURI) for encoding a complete URL while preserving its structural characters.
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a complete URL — it leaves characters like /, ?, &, =, #, : unencoded because they have meaning in URL structure. encodeURIComponent encodes a URL component (like a query string value) — it encodes those structural characters too, so the value won't break the URL structure when inserted.
When should I use encodeURIComponent?
Use encodeURIComponent when encoding a value that will be placed inside a URL query string. For example, if you have a search query "cats & dogs", it should become "cats%20%26%20dogs" so the & doesn't break the query string parsing.
What does %20 mean?
%20 is the percent-encoded representation of a space character. The percent sign followed by two hex digits represents the byte value of the character in UTF-8. Spaces can also be encoded as + in some contexts (form data), but %20 is the standard for URLs.