How Do You URL Encode an At Sign (@)?
The url encoding of "@" is %40. The at sign (@) is URL encoded as %40. In URLs, the @ symbol has a special role in the authority component (user@host). When you need a literal @ in a query parameter or path segment, encode it as %40 to avoid ambiguity.
Why Encode "@"?
The @ character separates user information from the host in a URL authority component (e.g., user:pass@example.com). If your data contains an email address or social media handle with @, encoding it as %40 prevents the URL parser from misinterpreting the host. This is especially important in REST APIs where email addresses are passed as path parameters or query values, and in OAuth redirect URLs that embed user identifiers.
Encoding Details
| Character | @ |
| Encoded form | %40 |
| Encoding type | URL encoding |
| Unicode code point | U+0040 |
Code Examples
JavaScript
encodeURIComponent('user@example.com');
// "user%40example.com"
Python
from urllib.parse import quote
quote('user@example.com')
# 'user%40example.com'
Try It Yourself
Use our URL Encoder to encode any character instantly.
Frequently Asked Questions
Is @ always unsafe in URLs?
The @ is only special in the authority component (between // and the first /). In path segments and query strings, it is technically allowed unencoded by RFC 3986, but encoding it is safer for maximum compatibility across browsers, servers, and HTTP client libraries.
How do I pass an email address in a URL?
Encode the entire email as a query parameter value: /invite?email=user%40example.com. Most URL-building functions in JavaScript (encodeURIComponent), Python (urllib.parse.quote), and other languages handle this encoding automatically.
Do APIs require @ to be encoded?
Most APIs accept @ unencoded in query strings, but encoding it as %40 is the safest approach for cross-platform compatibility. Always use your language's URL encoding function rather than doing string replacement manually, as it handles all special characters consistently.