Inputs
Results

How It Works

URL encoding replaces unsafe ASCII characters with percentage-encoded hexadecimal equivalents (e.g. spaces become `%20`). The tool calls JavaScript's built-in standard browser functions: `encodeURIComponent()` to escape parameter values and `decodeURIComponent()` to restore raw string values.

Formula Used

Percent Encoding = ConvertToPercentHex(UnsafeASCII)
URLs can only contain specific safe characters. Unsafe characters are replaced with a percent sign followed by their two-digit hexadecimal ASCII/UTF-8 representation.

Worked Example

Here is a step-by-step example of how these values are calculated:

Text hello world & test
Operation Encode
Result: Encoded Output: `hello%20world%20%26%20test`.

Frequently Asked Questions

Why is URL encoding necessary?
Query parameters inside URLs can only contain a limited set of ASCII characters. Unencoded characters (like spaces, `&`, or `?`) have syntactic meaning in URLs and will break arguments if not correctly escaped.
What happens if I try to decode an invalid URI format?
If the input contains a percentage character (`%`) that is not followed by a valid 2-digit hexadecimal representation, the JavaScript parser will throw an error, which the tool handles and displays.