What Is URL Encoding?
URL encoding, also called percent-encoding, converts characters that are not allowed in a URL into a format that can be transmitted safely. Characters like spaces, ampersands, question marks, and non-ASCII text are replaced with a percent sign followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and the Japanese character for Tokyo becomes %E6%9D%B1%E4%BA%AC. A web developer in Austin builds a search URL that includes a user query containing an ampersand. Without encoding, the browser would interpret the ampersand as a parameter separator. With encoding, the ampersand is transmitted as part of the query value, not as URL syntax.
URLs can only be sent over the internet using the ASCII character set. Since many real-world strings contain characters outside this set, percent-encoding is the bridge that makes them URL-safe. For encoding binary data, try our Base64 Encode / Decode tool.
What This Calculator Does
This URL encoder lets you encode plain text with percent-encoding and decode URL-encoded strings back to plain text. It uses the standard encodeURIComponent and decodeURIComponent functions and reports clear errors for malformed input.
- Inputs: Plain text or a URL-encoded string, plus a mode selector
- Outputs: Encoded or decoded result with character counts
How Percent-Encoding Works
Space → %20
& → %26
? → %3F
Each character that is not an unreserved ASCII character (alphanumeric, hyphen, underscore, period, or tilde) is replaced with a percent sign followed by the two-digit hexadecimal representation of its byte value in UTF-8. Multi-byte UTF-8 characters produce multiple percent-encoded sequences. The RFC 3986 standard defines which characters are reserved and must be encoded.
Common Use Cases
Query parameters: Encode user input before appending it to a URL so special characters do not break the URL structure. API requests: Many REST APIs require encoded values in the URL path or query string. Data URIs: Encode content embedded in href or src attributes. For generating secure tokens, use our Password Generator.
Limitations
This calculator uses encodeURIComponent, which encodes all characters except A-Z, a-z, 0-9, - _ . ! ~ * ' ( ). It does not encode the forward slash, so it is not suitable for encoding an entire URL at once. For full URL encode/decode with a reference table, see our URL Encode / Decode calculator.