Last updated
Which Technique to Choose
- HTML entity encoding — best for no-JavaScript environments, stops most simple bots
- JavaScript construction — best overall protection, works for 99% of use cases
- ROT13 — good secondary layer, easy to implement alongside other techniques
- CSS reversal — useful as a fallback when JavaScript is unavailable
- Multi-layer combined — maximum protection for high-visibility addresses like public contact pages
The Email Obfuscator on TechConverter.me generates clean, ready-to-use HTML for any of these techniques, with a live preview showing exactly how the address will appear to visitors. Protect your email addresses from spam harvesting without sacrificing usability.
`, 'ROT13': email.replace(/[a-zA-Z]/g, c => String.fromCharCode((c <= 'Z' ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26)), 'CSS Direction': `${email.split('').reverse().join('')}`, 'AT/DOT Replace': email.replace('@', ' [at] ').replace(/\./g, ' [dot] '), 'Mailto Obfuscated': `Contact`, 'Data Attribute': `Contact\n` }; let output_text = `🔒 Email Obfuscator\n\n`; output_text += `Original: ${email}\n\n`; for (const [method, obfuscated] of Object.entries(methods)) { output_text += `${method}:\n${obfuscated}\n\n`; } output_text += `Note: Obfuscation helps reduce spam but is not foolproof.\n`; output_text += `Modern spam bots can decode most obfuscation methods.`; result.textContent = output_text; output.classList.add('show'); if (typeof gtag !== 'undefined') { gtag('event', 'obfuscate_email', { 'event_category': 'tool_usage', 'event_label': 'email_obfuscate' }); } } catch (error) { alert('❌ Error: ' + error.message); } } function loadExample1() { document.getElementById('inputData').value = 'contact@example.com'; alert('✅ Example 1 loaded!'); } function loadExample2() { document.getElementById('inputData').value = 'support@mycompany.com'; alert('✅ Example 2 loaded!'); } // Allow Enter key in textarea (Ctrl+Enter to process) document.addEventListener('DOMContentLoaded', function() { const inputData = document.getElementById('inputData'); if (inputData) { inputData.addEventListener('keydown', function(e) { if (e.ctrlKey && e.key === 'Enter') { processTool(); } }); } });Examples
Example 1: HTML Entity Encoding
The simplest and most widely compatible technique replaces each character with its HTML entity equivalent. Given the email address contact@example.com, the obfuscator produces:
<a href="mailto:contact@example.com">
contact@example.com
</a>
Browsers decode these entities and display contact@example.com as a working mailto link. Most spam bots that scan raw HTML source cannot decode HTML entities and skip over the address entirely. This technique requires no JavaScript and works in all browsers.
Example 2: JavaScript Construction
For stronger protection, the obfuscator generates JavaScript that constructs the email address dynamically at page load time. The address never appears in the HTML source as plain text:
<script>
(function() {
var user = 'contact';
var domain = 'example';
var tld = 'com';
var el = document.getElementById('email-link');
el.href = 'mailto:' + user + '@' + domain + '.' + tld;
el.textContent = user + '@' + domain + '.' + tld;
})();
</script>
<a id="email-link" href="#">Enable JavaScript to view email</a>
Bots that only parse HTML without executing JavaScript see only the placeholder text. Visitors with JavaScript enabled see the full, clickable email address. This is highly effective against the vast majority of harvesting bots.
Example 3: ROT13 Encoding with JavaScript Decode
ROT13 shifts each letter by 13 positions. The encoded address is stored in the HTML and decoded by JavaScript when the page loads:
<!-- ROT13 of contact@example.com is pbagnpg@rknzcyr.pbz -->
<a href="#" data-email="pbagnpg@rknzcyr.pbz" class="rot13-email">
pbagnpg@rknzcyr.pbz
</a>
<script>
document.querySelectorAll('.rot13-email').forEach(function(el) {
var decoded = el.dataset.email.replace(/[a-zA-Z]/g, function(c) {
return String.fromCharCode(
(c <= 'Z' ? 90 : 122) >= (c = c.charCodeAt(0) + 13) ? c : c - 26
);
});
el.href = 'mailto:' + decoded;
el.textContent = decoded;
});
</script>