URL Encoder & Decoder
Encode special characters in a URL to their percent-encoded equivalents, or decode them back to plain text — free, instant, and 100% in your browser.
What is URL Encoding?
URL encoding (also known as percent encoding) is a mechanism to represent special characters in a URL using a safe, ASCII-compatible format. It replaces unsafe or reserved characters with a % sign followed by two hexadecimal digits representing the character's UTF-8 byte value.
For example, a space character ( ) becomes %20, and an ampersand (&) becomes %26.
URL encoding is essential because URLs can only be transmitted over the internet using the ASCII character set. Characters outside this set — or characters with special meaning in URLs (like ?, &, =) — must be encoded to avoid ambiguity.
Reserved Characters Cheat Sheet
These are the most commonly encountered characters that require encoding when used in a URL query string or path:
| Character | Description | Encoded Form |
|---|---|---|
| Space | %20 | |
| ! | Exclamation mark | %21 |
| # | Hash / Fragment | %23 |
| $ | Dollar sign | %24 |
| % | Percent sign | %25 |
| & | Ampersand (param separator) | %26 |
| ' | Single quote | %27 |
| ( | Open parenthesis | %28 |
| ) | Close parenthesis | %29 |
| + | Plus sign | %2B |
| , | Comma | %2C |
| / | Forward slash | %2F |
| : | Colon | %3A |
| ; | Semicolon | %3B |
| = | Equals (key=value separator) | %3D |
| ? | Question mark (query start) | %3F |
| @ | At sign | %40 |
| [ | Open bracket | %5B |
| ] | Close bracket | %5D |
Note: Unreserved characters (A–Z, a–z, 0–9, -, _, ., ~) are never encoded by encodeURIComponent.
When Should You Encode a URL?
Passing Data in Query Strings
When you embed user-provided data into a URL query parameter, always encode it. For example, a search query of "coffee & tea" must become ?q=coffee%20%26%20tea to prevent the & from being misinterpreted as a parameter separator.
API Requests and Webhooks
REST APIs require properly encoded URLs to route requests correctly. Many webhook payloads embed callback URLs that must be percent-encoded to survive being embedded inside another URL parameter.
SEO-Friendly URL Slugs
Modern browsers automatically display decoded URLs in the address bar for readability, but the underlying HTTP request always uses the encoded form. Ensuring your URLs are correctly encoded prevents broken links and improves crawlability for search engines.