URL Encoder / Decoder
Escape special characters in URLs or unescape them back.
Why Encode URLs?
URLs can only contain a limited set of characters (ASCII alphanumeric). Characters outside this set (like spaces, emojis, or foreign letters) or reserved characters (like &, ?, /) used in specific contexts must be converted into a valid format using percent-encoding (e.g., a space becomes %20).
Common Encoded Characters
- Space ( ): Encoded as
%20or+. Used to separate words. - Slash (/): Encoded as
%2F. Critical when passing a URL as a parameter inside another URL. - Ampersand (&): Encoded as
%26. Used to separate query parameters. - Question Mark (?): Encoded as
%3F. Indicates the start of a query string.
When to use this?
- Query Parameters: When sending data in a URL (like `?q=hello world`).
- Debugging: Reading complex API calls that look like gibberish.
- Security: Ensuring user inputs are safe and interpreted correctly by the server.