%40 is the URL-encoded at sign (@).
In a URL, %40 stands for the at sign (@). Here is when to encode it, what it does in each part of a URL, and what every major language outputs.
Quick facts
| Character | @ |
|---|---|
| Name | At sign |
| Unicode | U+0040 |
| UTF-8 bytes | 40 (1 byte) |
| Percent-encoded | %40 |
| Lowercase form | %40 — identical meaning |
| Double-encoded | %2540 |
| HTML form encoding | %40 |
| RFC 3986 class | Reserved — general delimiter |
What it means in a URL
In the authority part, @ separates user information from the host — so in https://bank.com@evil.example/ the real host is evil.example. In paths and queries it is allowed raw; email addresses in parameters are usually encoded as %40.
RFC 3986 class: Reserved — general delimiter. It marks the structure of a URL (scheme, authority, path, query, fragment), so as data it must be encoded.
When to encode it
| Where it appears | What to do |
|---|---|
| Path segment | Allowed raw (encoding is also fine) |
| Query value | Allowed raw (encoding is also fine) |
| Fragment | Allowed raw |
| Form body | Encode |
The mistake to watch for
Phishing links that put a trusted name before @. Browsers go to the host after the @.
What each language produces
Left as-is by JavaScript encodeURI(s), Go url.PathEscape(s); every other function in the table encodes it. Output for the single character, UTF-8 input, tested against the real runtimes (see the encoding comparator for your own strings).
| Function | Output | |
|---|---|---|
| JavaScript encodeURIComponent(s) | %40 | encoded |
| JavaScript encodeURI(s) | @ | kept |
| JavaScript URLSearchParams | %40 | encoded |
| Python urllib.parse.quote(s) | %40 | encoded |
| Python quote(s, safe="") | %40 | encoded |
| Python urllib.parse.quote_plus(s) | %40 | encoded |
| PHP rawurlencode($s) | %40 | encoded |
| PHP urlencode($s) | %40 | encoded |
| Java URLEncoder.encode(s, UTF_8) | %40 | encoded |
| Go url.QueryEscape(s) | %40 | encoded |
| Go url.PathEscape(s) | @ | kept |
| Ruby URI.encode_www_form_component(s) | %40 | encoded |
| Ruby ERB::Util.url_encode(s) | %40 | encoded |
| C# / .NET Uri.EscapeDataString(s) | %40 | encoded |
Decoding it
decodeURIComponent('%40') returns the at sign (@). Python: urllib.parse.unquote('%40'); PHP: rawurldecode('%40'). Paste any string into the URL decoder to decode it in your browser.
← %3F Question mark · Full URL encoding table · %5B Left square bracket →
Common questions.
%40 is the percent-encoded form of the at sign (@), whose byte value is 0x40. Decoding the URL turns it back into the character.
Yes. Hex digits in percent-encoding are case-insensitive, so %40 and %40 mean the same thing. RFC 3986 recommends uppercase, and mixing cases can make caches and analytics count one URL as two.
Use your language’s encoder on the value: encodeURIComponent in JavaScript gives %40, Python’s quote(s, safe="") gives %40, PHP’s rawurlencode gives %40.
More from the toolkit.
About this page. Written and maintained by Sri Murugan Systems, the developer of urlencodedecode.com. Character classes follow RFC 3986 §2; language outputs were generated by running each function in its real runtime.