%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@
NameAt sign
UnicodeU+0040
UTF-8 bytes40 (1 byte)
Percent-encoded%40
Lowercase form%40 — identical meaning
Double-encoded%2540
HTML form encoding%40
RFC 3986 classReserved — 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 appearsWhat to do
Path segmentAllowed raw (encoding is also fine)
Query valueAllowed raw (encoding is also fine)
FragmentAllowed raw
Form bodyEncode

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).

FunctionOutput
JavaScript encodeURIComponent(s)%40encoded
JavaScript encodeURI(s)@kept
JavaScript URLSearchParams%40encoded
Python urllib.parse.quote(s)%40encoded
Python quote(s, safe="")%40encoded
Python urllib.parse.quote_plus(s)%40encoded
PHP rawurlencode($s)%40encoded
PHP urlencode($s)%40encoded
Java URLEncoder.encode(s, UTF_8)%40encoded
Go url.QueryEscape(s)%40encoded
Go url.PathEscape(s)@kept
Ruby URI.encode_www_form_component(s)%40encoded
Ruby ERB::Util.url_encode(s)%40encoded
C# / .NET Uri.EscapeDataString(s)%40encoded

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.