How to Encode Email Addresses in URLs
Part of the Encoding Toolkit%40for @ — plus %2B for + if the address has one and it's going in a query string
Explanation
An email address has, at most, two characters worth thinking about: @ and, if the address uses one, +.
@ doesn't strictly need encoding to be valid inside a query value or path segment — the URL grammar allows it unencoded there. Encoding it to %40 anyway is just what encodeURIComponent does by default, and it's the safe, consistent choice.
+ is the one that actually matters. Inside a query string specifically, an unencoded + is read as a space — so jane+newsletter@example.com silently becomes a different (and broken) address the moment it's decoded, unless the + was encoded as %2B first. See URL Encoding Explained for why query strings treat + this way.
Valid examples
jane.doe%40example.com"jane.doe@example.com" encoded — @ becomes %40, encodeURIComponent's default.
jane%2Bnewsletter%40example.com"jane+newsletter@example.com" as a query value — the + must be %2B here or it's read as a space.
?email=jane.doe%40example.comA full query string carrying an encoded email value.
Invalid examples
?email=jane+newsletter@example.comUnencoded + in a query value — decodes back to "jane newsletter@example.com", a different, broken address.
jane.doe%2540example.comDouble-encoded — the % from the first encoding pass got encoded again.