Hiding Addresses
Tools & Toys

Obfuscating an email address for a Web page

Version 2.1
Copyright © 2006, 2008, 2009 by Hal Keen

Green light: scripts work Scripts on this page
are working.
Stop! Red light: no script support This page requires Javascript 1.2.

Sorry! If this warning didn’t go away, your browser didn’t run the scripts, and this page won’t work. Most browsers support the scripts, but your security settings might block them.

I don’t recommend weakening your security. Instead, you might try saving this Web page and running the saved copy. See the copy permissions.

This form converts an email address into an encoding not usually picked up by spammers, but (according to reports) universally understood by browsers. The output string is HTML code for a mail link. You need JavaScript support (version 1.2) in your browser to use this form, but the links encoded here can be used without any script support.

This technique is easily defeated if spammers ever take the trouble to program their Webcrawlers for it. Addresses published by this method should be “throwaway,” easily changed if (or, more likely, when) they become spam targets. That protects all users, not just you: if all addresses coded this way are likely to change when spammed, it's not worth their trouble to harvest them.

I strongly recommend that you track where you use or publish each address, so switching addresses is (relatively) quick and easy.

  1. Type the email address. Do not include the mailto: prefix.
  2. Type the text to be displayed on the link.
  3. If you want, type the name of the addressed recipient. (Most browsers and email clients should support this.)
  4. If you want, type text for either
    • a suggested beginning for the subject line – a colon and space are appended automatically – or
    • a short beginning for the message body.

    Put message text in:
    (only first line is used)
  5. When ready, click the Convert button at right to generate HTML code for the link.
  6. Select all contents of the Obfuscated link field and copy to your HTML source.
  7. Before publishing, test the link! Typos can happen to anyone.

I use here a technique originally learned from the website of Robert Graham. I can no longer find his site or other useful references online. With gratitude for his instruction, I publish this attempt at a comprehensive utility in hopes of perpetuating that knowledge to the benefit of (non-spamming) humanity.

A “partial conversion” option, offered in Version 1.0, no longer appears. It is not gone: instead, it is now the only mode offered. Full conversion was less efficient and no more effective.

Permission is granted to copy this page for personal use, provided: