Learn the essentials
Understanding URL Encoder Decoder
URL encoding represents characters with percent-encoded byte sequences so they can travel safely inside parts of a URL. Encoding an entire URL and encoding one query parameter are not always the same operation.
Encode components separately
A query value, path segment, fragment, and complete URL have different reserved characters. Encode user-provided values before inserting them into a URL rather than repeatedly encoding the finished string.
Watch for double encoding
If a percent sign is encoded a second time, %20 becomes %2520. Double encoding commonly appears when several application layers each assume they own URL construction.
Decoding untrusted URLs
Decoded text can reveal control characters, redirect targets, or misleading Unicode. Inspect the destination and scheme before opening a URL supplied by an unknown source.