Search tools

Email Obfuscator

Put your email address on a web page without handing it to spam bots.

Email Obfuscator tool

Preview

HTML entities (recommended)

A normal clickable mailto link, with every character written as an HTML code. Works without JavaScript and in every browser; stops simple scrapers that search the page source for “@”.

JavaScript

The address never appears in the HTML: a small script builds the mailto link when someone clicks. Strongest against scrapers, but needs JavaScript and isn’t allowed by a strict Content Security Policy.

CSS reversed text

The address is stored backwards and flipped by CSS. Readable on screen but not clickable, and copying it gives the reversed text.

Written out

Plain text such as “name [at] example [dot] com”. Easy for people, a small hurdle for bots, and works anywhere, including PDFs and images.

Processing runs in your browser.

Spam bots crawl the web looking for anything shaped like [email protected]. Put your address on a contact page in plain text and it will usually be on spam lists within weeks. Obfuscation makes the address unreadable to those simple bots while it still looks and works normally for visitors.

How each method works

  • HTML entities. Each character is written as a code, so h becomes h and @ becomes @. Browsers turn the codes back into text, but bots that search the raw HTML for an @ sign find nothing.
  • JavaScript. The address is split, encoded and only put together when someone clicks. It never appears in the page source at all.
  • CSS reversed. The address is stored backwards and displayed the right way round by CSS. It’s good for showing an address, but people can’t click it.
  • Written out. hello [at] example [dot] com is the old standby. It’s clear to people and works in plain-text places, such as PDFs or social media bios.

Choosing for your site

For a small business or personal site, the entity version is the best balance. It looks normal, the link works, and it needs no scripts. If you still get spam, switch to the JavaScript version or use a contact form with a honeypot field.

Other ways to cut spam

Use a separate public address, such as hello@, that you can filter or replace. Turn on your mail provider’s spam filtering. Don’t list staff addresses individually; route enquiries through one shared mailbox.

How to use the Email Obfuscator

  1. Enter the email address you want to publish.
  2. Optionally add link text, such as “Email us”.
  3. Pick a method. HTML entities work almost everywhere; JavaScript gives the most protection.
  4. Copy the code and paste it into your page’s HTML.

Features

  • Four methods: HTML entities, JavaScript assembly, CSS reversed text and written-out text.
  • Entity version mixes decimal and hex codes so simple pattern matching misses it.
  • JavaScript version keeps the address out of the HTML completely, Base64-encoded in data attributes.
  • Live preview of the clickable link.
  • Link text is HTML-escaped, so special characters can’t break your page.

Frequently asked questions

Does email obfuscation still work?

It stops most automated harvesters, which simply scan page source for text shaped like an address. Bots that run a full browser can still read it, so combine it with a good spam filter, or use a contact form for high-traffic sites.

Which method should I use?

HTML entities for most sites: the link works for everyone, with or without JavaScript. Use the JavaScript version if you get a lot of spam and your site allows inline scripts. Use the written-out version in places where you can’t add HTML.

Is it bad for accessibility?

The entity and JavaScript versions give screen reader users a normal email link. The CSS reversed version reads correctly on screen, but screen readers and copy-paste may get the reversed text, so avoid it as the only way to contact you.

Will the JavaScript version work on my site?

Only if your site allows inline event handlers. A strict Content Security Policy blocks them; in that case, use the entities version or move the script into your own JavaScript file.

Written by