URL Encoder
Encode text so it can be placed safely inside a URL — spaces, ampersands and non-ASCII characters are converted to their percent codes.
Characters
84
Fully encoded
https%3A%2F%2Fvelnaro.com%2Fsearch%3Fq%3Dkg%20to%20lbs%20%26%20category%3Dconverters
Encoded (keeps URL structure)
https%3A//velnaro.com/search%3Fq%3Dkg%20to%20lbs%20%26%20category%3Dconverters
How this was worked out
- How it worksencodeURIComponent replaces every character outside the unreserved set with a % followed by two hexadecimal digits.
Formula
Percent-encoding: %XX where XX is the hexadecimal byte value
Example
Input
kg to lbs
Result
kg%20to%20lbs
Frequently asked questions
encodeURIComponent encodes everything except unreserved characters, which is what you want for individual values. encodeURI leaves the URL structure intact.
Both are valid in different contexts: %20 in paths, + in query strings built by HTML forms.
Related tools
Keep going — these tools solve the problems that usually come next.