Privacy and Security

How to Hide Your Email Address From Spam Bots

Why plain email addresses on websites attract spam, how obfuscation methods compare on protection and accessibility, and what else reduces contact spam.

Saizul Amin
Saizul Amin2 Nov 2026 · 3 min read
How to Hide Your Email Address From Spam Bots

How to Hide Your Email Address From Spam Bots

Put a plain email address on a website and the spam usually starts within days. Automated harvesters crawl the web looking for anything shaped like name@domain and add it to lists that are sold and reused for years. Yet visitors, and in many countries the law, expect a business to show a way to contact it. Obfuscation keeps the address usable for people and harder for bots. The Email Address Obfuscator generates the code. This guide compares the methods.

How harvesters work

Most harvesters download the raw HTML of a page and search it with patterns for email addresses and mailto: links. The simplest ones do not run JavaScript or render CSS. More advanced ones decode HTML entities, and a few run full browsers. Obfuscation works by making the address absent from the raw HTML or hard to recognise.

The methods compared

JavaScript assembly. The address is stored in pieces, often reversed, and a short script builds the mailto link when the page loads. Visitors see a normal clickable link; the HTML never contains the address. This blocks most harvesters and is the usual best choice.

ROT13 or Base64 with JavaScript. Similar idea with an encoded address that the browser decodes. Equally effective against simple bots.

HTML entities. Each character is written as a numeric reference, such as @ for @. Browsers display it normally and it works without JavaScript, but many harvesters decode entities, so protection is weak.

CSS reversed text. The address is written backwards and displayed correctly using CSS direction. It hides the address from text-based scrapers, but is not clickable, may copy backwards and can confuse screen readers.

At/dot wording. Writing name [at] domain [dot] com is readable by people but asks them to retype it, and some visitors give up.

Contact form. A form that assembles the address only when the visitor sends a message. Combined with server-side spam filtering, a real contact form is often the best option for busy sites.

Accessibility and usability

Links created by JavaScript are announced normally by screen readers and work on phones, opening the default email app. Provide a fallback, such as a link to a contact page, for the few visitors without JavaScript. Avoid images of email addresses: they are inaccessible to blind visitors and can still be read by text recognition.

Other ways to cut spam

  • Use a dedicated public address, separate from your personal one, so you can filter it or replace it.
  • Turn on strong spam filtering at your mail provider.
  • Check that the address does not also appear in plain form in page titles, structured data, PDFs or old pages.

Testing your page

After adding the code, view the page source (not the inspected page) and search for the @ sign and your domain. If the address appears in plain text, something in your site, such as a theme footer, a schema block or a plugin, is still publishing it. Then open the page on a phone and tap the link to check that the email app opens with the right address and subject. Finally, test with JavaScript disabled to see what visitors without it get, and make sure the fallback still leads them to a working contact route, such as a contact page or a phone number.

In the EU and UK, online businesses must provide contact details, including an electronic way to reach them quickly. A clickable obfuscated address meets that requirement for human visitors.

Summary

Prefer JavaScript-assembled links with a contact page fallback, avoid relying on entities alone, and back it up with a separate public address and good filtering. Generate and preview the code with the email obfuscator.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages