Is there any WebApp that allows you to publish an e-mail on the web using a script tag that protects it from robots?

To be more clear: I want to publish a post on Blogspot that prints my e-mail on the screen as a selectable and copyable text, but hides it from the HTML source code. This is an anti-spam technique.

I imagine the solution is some javascript that fetches the e-mail address from a server, or that decrypts it from existing data. I know this could be a programming question if the solution doesn't need no server-side programming, but I'm not sure about this.

3 Answers 3


There are a bunch of sites that generate the code. It generally entails breaking up the email address into a few variables, and then writing them to the screen. Simple example:

<script type="text/javascript">
    dot = "."
    part1 = "john"
    part2 = "doe"
    part3 = "gma"
    part4 = "il"
    part5 = "co"
    part6 = "m"

    document.write( part1 + dot + part2 + "@" + part3 + part4 + dot + part5 + part6

    //returns [email protected]

More complex options will convert each letter into the HTML element.

Check out http://www.mobilefish.com/services/hideemail/hideemail.php#hideemail_input as an example

  • I like the service you linked because I don't have to code to use it. But I also would like to see more services like it.
    – Jader Dias
    Oct 13, 2010 at 2:43
  • 1
    There are a bunch out there. Search for things like email obfuscation, javascript anti-spam email address, etc. Add the word "generator" on to the search if you just want an app and not the tutorial part. Glad to help! Oct 13, 2010 at 2:47

I use the Hivelogic enkoder.


We use a VB Function to generate the mail addresses. It encodes the addresses to UTF-8 or hex. You can convert it to any language you wish. This is the VB.NET code:

' Convert An Input String To Unicode Character Codes
Public Enum CloakType
End Enum

Public Function CloakIt(ByVal inTxt As String, ByVal iType As CloakType) As String
    Dim iInd As Integer
    Dim sOut As String
    sOut = ""
    If Len(inTxt) = 0 Then
        CloakIt = ""
        Exit Function
    End If
    For iInd = 1 To Len(inTxt)
        Select Case iType
            Case CloakType.UTF8_2 ', 2
                ' Long UTF-8 encoding without semicolons
                sOut = sOut & "&#" & Right("0000000" & CStr(Asc(Mid(inTxt, iInd, 1))), 7)
            Case CloakType.HEX_1 ', 3
                ' Hex encoding without semicolons
                sOut = sOut & "&#x" & Hex(Asc(Mid(inTxt, iInd, 1)))
            Case CloakType.HEX_2 ', 4
                ' Hex encoding with semicolons
                sOut = sOut & "&#x" & Hex(Asc(Mid(inTxt, iInd, 1))) & ";"
            Case CloakType.UniCode ', 5
                ' Unicode 2 Byte Hex encoding with semicolons
                sOut = sOut & "&#x00" & Hex(Asc(Mid(inTxt, iInd, 1))) & ";"
            Case Else
                ' UTF-8 Unicode Encoding
                sOut = sOut & "&#" & CStr(Asc(Mid(inTxt, iInd, 1))) & ";"
        End Select
    CloakIt = sOut
End Function

Not the answer you're looking for? Browse other questions tagged or ask your own question.