OD2 Temp Mail Android App is LIVE! 🎉

V1.3

Get Early Access today on Google Play Store

v1.1.0 Released

OTP Detector

Intelligent OTP extraction for modern applications. A robust, dependency-free utility to capture verification codes with context-aware heuristics.

$npm install @onedaydevelopers/otp-detector
Smart Extraction
Uses heuristic analysis to distinguish actual OTPs from other numbers like dates, amounts, or phone numbers.
Privacy Focused
Runs completely client-side (or server-side). No data is ever sent to external servers.
Versatile Input
Works with raw SMS body, email content (Subject/Body), or HTML snippets.

Live Demo

Input Text
Paste an email or SMS content here.

Detected Code

---

How to Use

Simple integration for any JavaScript environment.

Basic String Extraction

Extract an OTP from a simple string. The library automatically identifies 4-8 digit codes while filtering out noise.

import { extractOTP } from '@onedaydevelopers/otp-detector';

const text = "Your verification code is 5824.";
const otp = extractOTP(text);

console.log(otp); // "5824"

Frequently Asked Questions

Frequently asked questions about the OTP Detector library.

Finding this helpful?

Support our work to keep these tools free and open for everyone.