URL Encoder/Decoder
What Is URL Encoding?
URL encoding (also called percent-encoding) is a mechanism for encoding information in a Uniform Resource Locator (URL) under certain circumstances. It converts characters that are not allowed in a URL into a format that can be transmitted over the internet.
In URL encoding, special characters are replaced with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII value. For example, a space becomes %20, and an ampersand (&) becomes %26.
This encoding is essential because URLs can only be sent over the internet using the ASCII character set. Since URLs often contain characters outside this set, encoding ensures compatibility and proper transmission.
Common URL-Encoded Characters
| Character | URL Encoding | Character | URL Encoding |
|---|---|---|---|
| Space | %20 | & | %26 |
| ! | %21 | ' | %27 |
| # | %23 | ( | %28 |
| $ | %24 | ) | %29 |
| % | %25 | * | %2A |
| + | %2B | , | %2C |
| / | %2F | : | %3A |
| = | %3D | ? | %3F |
| @ | %40 | [ ] | %5B %5D |
How to Use This URL Encoder/Decoder
- Enter text: Type or paste any text you want to encode or decode.
- Choose action: Select whether to encode (text → URL format) or decode (URL format → text).
- See results: The tool instantly shows the converted output.
- Copy output: Click the copy button to copy the result to your clipboard.
URL Encoding Examples
Simple Text
Original: Hello World
Encoded: Hello%20World
Email Address
Original: user@example.com
Encoded: user%40example.com
Query String
Original: name=John Doe&age=25
Encoded: name%3DJohn%20Doe%26age%3D25
Special Characters
Original: 100% complete!
Encoded: 100%25%20complete%21
When to Use URL Encoding
- Query parameters: When passing data in URL query strings (e.g.,
?name=John%20Doe). - Special characters: When URLs contain spaces, punctuation, or non-ASCII characters.
- Form submissions: When sending form data via GET method.
- API requests: When constructing API URLs with dynamic values.
- File names: When linking to files with special characters in their names.
Reserved Characters in URLs
Certain characters have special meanings in URLs and must be encoded when used in data:
- ? - Starts the query string
- & - Separates query parameters
- = - Assigns values to parameters
- # - Indicates a fragment identifier
- / - Separates path segments
- : - Follows the protocol (http:, https:)
Tips for Working with URLs
Always encode user input: Any data that comes from users should be URL-encoded before being placed in a URL to prevent errors and security issues.
Double encoding: Be careful not to encode already-encoded data. %20 encoded again becomes %2520, which is incorrect.
Plus signs: In query strings, spaces are sometimes encoded as + instead of %20. Both are valid but %20 is more universally accepted.
UTF-8: Modern URL encoding uses UTF-8 to support international characters. Older systems may use different encodings.
Frequently Asked Questions
What is URL encoding?
URL encoding converts characters that have special meaning in URLs (like spaces, &, =) into percent-encoded format (%20, %26, %3D) so they can be transmitted safely.
When should I use URL encoding?
When including special characters in URL query parameters, form submissions, or API requests where characters could be misinterpreted.
What does %20 mean in a URL?
%20 represents a space character. URLs cannot contain literal spaces, so they are encoded as %20 (or sometimes + in form data).