URL Encode/Decode
URL-encode and decode text instantly. Supports component and full URI modes.
100% Private — Your files never leave your device.
All processing happens in your browser. Nothing is uploaded to any server.
Encodes everything — use for query parameters and values
Common URL Encodings Reference
How it works
What Is URL Encoding?
URL encoding (percent-encoding) is a mechanism for encoding characters that aren’t allowed in URLs. It replaces unsafe characters with a % sign followed by two hexadecimal digits representing the character’s byte value.
Why It Exists
URLs can only contain a limited set of characters from the US-ASCII character set. The RFC 3986 specification defines which characters are allowed:
- Unreserved characters (always safe):
A-Z a-z 0-9 - _ . ~ - Reserved characters (have special URL meaning):
: / ? # [ ] @ ! $ & ' ( ) * + , ; = - Everything else must be percent-encoded
Component vs Full URI Mode
| Feature | Component Mode | Full URI Mode |
|---|---|---|
| Function | encodeURIComponent() | encodeURI() |
| Encodes | Everything except A-Z a-z 0-9 - _ . ! ~ * ' ( ) | Only spaces and non-ASCII characters |
| Preserves | Nothing else | : / ? # @ ! $ & ' ( ) * + , ; = |
| Use for | Query parameter values | Complete URLs with minor issues |
When to Use Each
Component mode — Use when encoding a single value that will be placed into a URL:
// Encoding a search query for a URL parameter
?search=hello%20world%26more ← correct (& is encoded)
Full URI mode — Use when you have a complete URL that just needs spaces or accented characters fixed:
https://example.com/my page → https://example.com/my%20page ← correct (structure preserved)
Common Encoded Characters
| Character | Encoded | Description |
|---|---|---|
| (space) | %20 | Most common encoding |
! | %21 | Exclamation mark |
# | %23 | Hash/fragment |
$ | %24 | Dollar sign |
& | %26 | Ampersand (query separator) |
+ | %2B | Plus sign |
/ | %2F | Forward slash |
: | %3A | Colon |
= | %3D | Equals sign |
? | %3F | Question mark |
@ | %40 | At sign |
Privacy
All encoding and decoding happens in your browser using JavaScript’s native encodeURIComponent() and decodeURIComponent() functions. No data is sent to any server.
Real-World Examples
Encoding a search query parameter
A developer needs to pass a user's search query as a URL parameter. The text 'best café in São Paulo' contains accented characters that aren't safe in URLs. Component encoding produces 'best%20caf%C3%A9%20in%20S%C3%A3o%20Paulo', which can be safely appended to a URL like '?q=best%20caf%C3%A9%20in%20S%C3%A3o%20Paulo'.
Decoding a URL from analytics
A marketing analyst receives a fully-encoded URL from their analytics platform. Decoding reveals the original URL: 'https://example.com/path?q=hello world&lang=en'. This makes it easy to understand which pages users are visiting without mentally parsing percent-encoded characters.
Encoding a full URL with spaces
A developer has a URL with spaces that needs to be valid. Using Full URI mode preserves the URL structure (://?=) while encoding only the spaces: 'https://example.com/my%20page?name=John%20Doe'. Unlike Component mode, this preserves the URL's structural characters.
Frequently Asked Questions
What is URL encoding?
What is the difference between Component and Full URI encoding?
Why do I see %20 instead of + for spaces?
Which characters need to be URL-encoded?
Can I URL-encode binary data?
Is URL encoding the same as HTML encoding?
Related Calculators
Base64 Encode/Decode
Encode text or files to Base64 and decode Base64 back instantly.
JWT Decoder
Decode JWT tokens to inspect header, payload, and expiration.
JSON Formatter
Format, validate, and beautify JSON with syntax highlighting.
QR Code Generator
Create QR codes for URLs, text, Wi-Fi, and more.
Password Generator
Generate strong, random passwords with customizable options.