When you put your email address in your web page you publish it to the entire world. That is both a good thing and a bad thing. It’s good because lots of potential customers can contact you and do business with you. It’s bad because some very annoying people called spammers can get your email address and send you lots of advertising for products you don’t want. Spammers use programs called spam-bots to generate their email lists. Spam-bots automatically search the web downloading all the web pages they can find and searching them for email addresses. One way to fool the spam-bots is to scramble the email addresses in your web page and have the page reference a decoder script that is run on the user’s browser.

This works most of the time because most spam-bots only download the HTML source of your web page and don’t download and run any scripts associated with the page. They just search the raw HTML for anything that looks like an email address. If your HTML file has all the email addresses scrambled, the spam-bots may not even recognize them as email addresses, and if they do, they almost certainly won’t be able to decode them.

Here is an email scrambler with a script you can include in your web page to decode scrambled email addresses. Type an email address in the input field below then click the “Scramble” button.

email address:

Insert this anchor element in your html document...


...and it will create this email link after decoding:

Click here to view the JavaScript that decodes a scrambled email address (you can download it below).

An HTML file that includes a scrambled link to the email address:

Will have the following elements at a minimum:

    <title>My Page</title>
    <script type="text/javascript" src="decodeEmail.js"></script> 
  <body onload="decodeEmail()"> 
    <a href="mailto:" name="e_mail">eela.cnmmpoooosscee m@</a> 

the decoder script and example HTML file and extract the 2 files (“decodeEmail.js” and “example.html”) into a directory, then use your favorite browser to display the “example.html” file. You should see the decoded email address (someone@someplace.com). If so, congratulations, you have gotten the script working. Now use the scrambler at the top of this page to generate anchor elements for all the email addresses you want in your web page, and put them into your new HTML file. This should get you started hiding your email addresses from spam-bots. Good luck!

Last updated: Tuesday, October 07, 2008 02:07:47 AM