URL Encoder / Decoder
Encode and decode URLs and query parameters. Supports encodeURIComponent for params and encodeURI for full URLs
How URL Encoding Works
URL encoding (also called 'percent-encoding') replaces special characters with %XX where XX is the hex code of the character. So a space becomes %20, & becomes %26, # becomes %23. RFC 3986 defines which characters need encoding. Letters, digits, and -_.~ are 'unreserved' and pass through unchanged.
Used everywhere URLs include user input. Search queries: 'hello world' becomes 'hello%20world' (or 'hello+world' in form data). Special characters in URLs: 'cafΓ©' becomes 'caf%C3%A9' (UTF-8 bytes percent-encoded). Always encode untrusted input before placing it in a URL - failure to encode causes broken links and is a common source of XSS vulnerabilities.
Common URL Encodings
| Character | Encoded |
|---|---|
| space | %20 (or + in forms) |
| # | %23 |
| & | %26 |
| ? | %3F |
| / | %2F |
| : | %3A |
| = | %3D |
| @ | %40 |
| cafΓ© (UTF-8) | caf%C3%A9 |
Frequently Asked Questions
Why are some characters encoded and others not?
Reserved characters (?, &, =, /, etc.) have special meaning in URLs - encoding preserves their literal value when used in data. Unreserved (letters, digits, -_.~) have no special URL meaning and stay as-is. The line is set by RFC 3986 spec; modern systems follow it strictly.
Is + the same as %20?
In query strings (form data after ?): yes, + represents space. In path components (before ?): no, + is literal +. Use %20 if you want a space in a path component. Most URL encoders default to + for query strings, %20 for paths.
Related Tools
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text. Supports UTF-8 with auto-convert mode and copy buttons
HTML Entity Encoder
Encode text to HTML entities or decode entities back to text. Handles named, numeric and hex entities. Bulk text support with instant copy to clipboard.
Slug Generator
Convert any title or text into a clean URL-friendly slug. Options for separator style, max length and accent transliteration. Copy to clipboard instantly.