URL Encoder/Decoder
Percent-encode and decode any string safely.
Why URLs need encoding at all
A URL may only contain a limited set of ASCII characters, and a handful of those — ?, &, =, /, # — carry structural meaning. Percent-encoding replaces anything else with a % followed by the hexadecimal value of each UTF-8 byte, so a space becomes %20 and é becomes %C3%A9. Without it, a value containing an ampersand would silently split into two query parameters.
A single value or a whole URL?
The distinction matters more than it looks. Encoding a single value escapes the reserved characters as well, which is correct when you are dropping user input into a query string. Encoding a whole URL leaves the reserved characters intact so the address stays a working address — run that mode over a value and its ampersands will survive to break your query string later.
Encoding twice is a real bug
If a string already contains %20 and you encode it again, the percent sign itself gets escaped and you end up with %2520. This is the usual cause of filenames and search terms that render with visible percent codes in production. Decoding the input first, checking that it looks the way you expect, and only then encoding once is the reliable habit.