URL Encoder / Decoder
Encode and decode URLs and URL components with percent-encoding. 100% client-side.
Special Character Reference ▸
| Character | Encoded | Description |
|---|---|---|
| %20 | Space | |
| ! | %21 | Exclamation |
| # | %23 | Hash |
| $ | %24 | Dollar |
| & | %26 | Ampersand |
| ' | %27 | Single quote |
| ( | %28 | Open paren |
| ) | %29 | Close paren |
| + | %2B | Plus |
| , | %2C | Comma |
| / | %2F | Slash |
| : | %3A | Colon |
| = | %3D | Equals |
| ? | %3F | Question mark |
| @ | %40 | At sign |
About This Tool
## Understanding URL Encoding
URL encoding, formally known as percent-encoding, is defined in RFC 3986. It ensures that URLs contain only valid ASCII characters by replacing unsafe characters with a % followed by their hexadecimal value.
### Reserved vs. Unreserved Characters
**Unreserved characters** (never encoded): A-Z, a-z, 0-9, - _ . ~
**Reserved characters** (encoded when used outside their special meaning): : / ? # [ ] @ ! $ & ' ( ) * + , ; =
### When to Use Each Function
Use `encodeURIComponent()` when encoding a value that will be placed in a query parameter, path segment, or fragment. Use `encodeURI()` only when encoding a complete URL string where you want to preserve the URL structure characters.
### Security Considerations
Always encode user-supplied data before inserting it into URLs to prevent URL injection and open redirect vulnerabilities. Double-encoding (encoding an already-encoded string) is a common mistake that leads to broken links.