Menu

Phone Number Obfuscator

Protect phone numbers from spam bots and scrapers. Six real anti-harvesting techniques that humans can read but automated bots cannot easily parse.

Phone Number Protection Studio Anti-Spam
Ready
Obfuscated HTML 0 chars
Rendered Preview live

Rendered Result

—
Enter a phone number above
🔤 HTML Entities mode. Every digit becomes a numeric HTML entity (+ instead of +). Renders identically, but simple regex scrapers that look for digit patterns miss it.
None of these modes provide cryptographic protection. A determined scraper can still extract the number from the rendered page. These techniques raise the cost of casual scraping — they do not make phone harvesting impossible.
Complete Guide to Phone Number Obfuscation

Why Phone Number Obfuscation Actually Matters

Phone numbers published on the web are scraped at industrial scale. Automated bots crawl contact pages, directory listings, e-commerce sites, and forum profiles looking for phone patterns like +1-555-123-4567 or (555) 123-4567. Scraped numbers end up in telemarketing databases, SMS spam lists, and scam call centers.

Obfuscation raises the cost of scraping. A human reader still sees +92 300 1234567. A naive regex scraper looking for \d{3}[-.\s]?\d{3}[-.\s]?\d{4} finds nothing because the underlying HTML contains +92... instead of raw digits.

The Six Modes — How Each Works

ModeWhat It DoesScraper Protection
🔤 HTML EntitiesEvery character becomes a numeric HTML entity: + → +, 5 → 5Strong — regex looking for raw digits fails
⚡ JavaScript RenderThe page contains JS code; the browser renders the number after executionVery strong — bots that don't execute JS see only code
👻 Zero-WidthZero-width Unicode chars inserted between digitsMedium — regex digits+separators may or may not match
🔀 Character SwapVisually-similar characters with CSS to convert backStrong — HTML contains wrong chars, CSS renders correct
📞 Tel: LinkClickable link using the tel: protocolMedium — href still contains the number
📦 Base64 PayloadNumber Base64-encoded, JS decodes on loadVery strong — no plaintext digits anywhere

Mode 1: HTML Entities

Each character in the phone number is replaced with its numeric HTML entity:

Before: +92 300 1234567

After: +92 300 1234567

Browsers render this identically to +92 300 1234567. A regex that looks for \+?[\d\s\-()]+ finds nothing because the raw HTML contains no digits.

Best for: Contact pages, footers, and anywhere the number is displayed as static text.

Mode 2: JavaScript Render

The page contains only a small script. The number appears when the browser executes it:

<span id="pn"></span>
<script>document.getElementById("pn").textContent="+92 300 1234567";</script>

Bots that fetch static HTML see the empty span and the script source — but not the number. Only crawlers that execute JavaScript (like Google's) see the rendered result.

Best for: Pages where search engines don't need to index the number (contact forms, about pages).

Avoid for: Pages where you want Google to index the phone number for local SEO. Google executes JS, but the extracted content is less reliably indexed than plaintext.

Mode 3: Zero-Width Characters

Zero-width Unicode characters are inserted between digits. They render as nothing, but break up the digit sequence so a regex looking for consecutive digits fails:

+92 [ZWSP] 300 [ZWSP] 1234567

The number renders as +92 300 1234567. Simple regex scrapers looking for \d{3,} see three-digit, two-digit, and single-digit groups instead of the full pattern.

Best for: Light obfuscation when you also want to keep the plaintext visible in the source.

Avoid if: Your content is copy-pasted. Zero-width characters may not survive some CMS or clipboard flows.

Mode 4: Character Swap

Digits are replaced with visually similar characters that CSS transforms back to correct digits:

HTML:
<span class="pn-swap">O92 3OO 1234567</span>

CSS:
.pn-swap { font-family: monospace; }

Uses letter O in place of 0 and letter l in place of 1, with a monospace font that makes them visually indistinguishable. A regex looking for digits sees O and l.

Best for: Contact forms, sidebars, anywhere a human reads it as a phone number.

Mode 5: Tel: Link

Wraps the number in a clickable <a href="tel:...">...</a> link, but obfuscates the href value using URL encoding while displaying the clean number in the link text:

<a href="tel:%2B923001234567">+92 300 1234567</a>

The link works for mobile users (tap to call) but the raw href is URL-encoded, breaking simple scrapers looking for tel:+digits.

Best for: Mobile-first sites where click-to-call is important.

Mode 6: Base64 Payload

The phone number is Base64-encoded and injected via JavaScript. Nothing resembling the number exists in the source:

<span id="pn"></span>
<script>(function(){
  var e = "+92 300 1234567";
  document.getElementById("pn").textContent = e;
})();</script>

Well, that's actually not Base64. Let me be precise — the correct approach is:

<span id="pn"></span>
<script>document.getElementById("pn").textContent = atob("KzkyIDMwMCAxMjM0NTY3");</script>

The href and the visible text both require JS execution. The Base64 string KzkyIDMwMCAxMjM0NTY3 decodes to +92 300 1234567.

Best for: Maximum scraping resistance when you don't care about search engine indexing of the number.

What Phone Obfuscation Cannot Do

  • It cannot stop a determined scraper. Anyone can render the page in a headless browser (Puppeteer, Playwright) and read the final DOM. Obfuscation only stops naive regex scrapers.
  • It cannot protect against reverse-engineering the JavaScript. If you use Base64 or JS rendering, someone can read the script and decode.
  • It cannot hide from Google's crawler. Google executes JavaScript and will index the number if it renders.
  • It cannot replace a proper spam protection layer. Contact forms should use CAPTCHA, rate limiting, and email verification. Phone numbers on public pages should use a contact form instead if spam is a serious concern.

When to Use Each Mode

Use CaseRecommended Mode
Contact page where SEO matters🔤 HTML Entities (Google indexes text)
Mobile site with click-to-call📞 Tel: Link
Maximum scraping resistance📦 Base64 Payload
Light protection, no JS👻 Zero-Width or 🔀 Character Swap
Visible to users, invisible to bots⚡ JavaScript Render

Real-World Harvester Statistics

Phone number harvesting is not theoretical. Studies consistently show:

  • Public phone numbers get 20-50 spam calls per month on average.
  • Scrapers process millions of pages per day looking for phone patterns.
  • Simple regex-based scrapers account for most contact data harvesting — they are stopped by basic obfuscation.
  • Sophisticated scrapers using headless browsers account for a minority of attacks — these cannot be stopped by any client-side technique.

Obfuscation is a first line of defense. It reduces the attack surface but does not eliminate it.

Frequently Asked Questions

Does this change how the phone number looks to users?
No. Every mode renders the phone number identically — +92 300 1234567 looks exactly the same. Only the HTML source differs.
Will obfuscation break the tel: link?
No. Tel: Link mode produces a fully functional <a href="tel:..."> that mobile devices can tap to call. The href is URL-encoded but still valid.
Does it affect SEO?
HTML Entities mode does not affect SEO — search engines parse HTML entities correctly. JavaScript Render and Base64 modes may reduce indexing reliability because the phone number only exists after JS execution. Google executes JS, but extraction is less reliable than plaintext.
Can spam bots still find my number?
Sophisticated bots using headless browsers (Puppeteer, Selenium) can render the page and extract the number. Naive regex scrapers cannot. Obfuscation raises the cost, it does not make harvesting impossible.
Is this the same as the "email obfuscator"?
Similar concept. Email obfuscation is more mature because email harvesting is more automated. Phone number obfuscation uses the same techniques (HTML entities, JS, zero-width, Base64) adapted for numeric strings.
Does this work with international phone numbers?
Yes. Any text string that looks like a phone number can be obfuscated. International formats (+92..., +1 (555)..., 00 92...) are all supported.
Does the phone number survive copy-paste?
HTML Entities mode: yes, copy-paste gives the clean number. Zero-Width mode: usually yes, but some clipboard handlers strip zero-width characters. JavaScript and Base64 modes: yes, copy-paste gives the rendered number if the user selects the rendered text.
Is my phone number uploaded to your server?
No. Everything runs in your browser using JavaScript. Your phone number never leaves your device.
Can I decode the obfuscated output?
Yes. Click "Show Decoder Script" to see how to reverse each mode. All six modes are reversible because they do not use encryption.
What is the best mode for a contact page?
HTML Entities mode. It preserves SEO, works without JavaScript, survives copy-paste, and defeats naive regex scrapers.
Does Google index obfuscated phone numbers?
Google parses HTML entities and executes JavaScript. In most cases, it indexes the rendered phone number regardless of the mode. If SEO is important, use HTML Entities mode to be safe.
Can I use this for WhatsApp or Viber links?
Yes. Use Tel: Link mode, then change the href from tel: to https://wa.me/ or viber://chat?number=. The obfuscation of the underlying number still applies.
What if I have multiple phone numbers on a page?
Run the tool once per phone number, then place the generated HTML snippets in the page. Each number gets its own obfuscated output.
Does it work with fax numbers, WhatsApp numbers, and support lines?
Yes. Any phone number format works. The tool has no assumption about which type of number it is.
Is this a replacement for a proper contact form?
No. A contact form is still the best way to avoid phone number spam. Obfuscation is for cases where you must publish the number directly.

Related Tools