Verification code extractor
Paste a verification text below and the tool returns only the code, without the spaces, dashes or “G-” prefix the sender added. It ignores the other numbers a message carries, such as prices, dates, phone numbers and “reply STOP to 12345”. When two numbers could each be the code, it returns nothing instead of guessing.
Checked by VerifyWith on
Nothing you paste leaves this page.
This is the example message’s code. Paste yours above to replace it.
What it finds, and what it leaves alone
| The text says | The tool returns | Why |
|---|---|---|
| Your code is 153-811 | 153811 | Dashes and spaces are for reading, not for typing. |
| G-482913 is your Google verification code | 482913 | A one to three letter prefix is the sender’s mark, not part of the code. |
| Use code AB12CD to sign in | AB12CD | Letters and digits mixed, straight after a label, count as a code. |
| Use promo code SAVE20 for $5 off | Nothing | Promo, coupon, order and tracking codes are not verification codes. |
| Code 4471. Call 800 555 0199 for help | 4471 | Phone numbers, prices, dates and times are masked before the search. |
| Codes 1234 and 5678 are both valid | Nothing | Two candidates and no way to choose. No answer beats a wrong one. |
How the extractor decides
A single pattern like “the first six digits” breaks on real messages, because verification texts are full of other numbers. The extractor works in order of confidence instead:
- Mask what can’t be a code. Links, email addresses, phone numbers, short codes to reply to, prices, percentages, dates, times and card endings are blanked out first.
- Look for a labelled code. “Code is 123456”, “123456 is your code”, “use 123456 to”. If labels point at two different codes, it stops.
- Then a labelled code with letters, only when it mixes letters and digits and sits right beside the label.
- Then an unlabelled number, only when the message is plainly about signing in and holds exactly one number of four to eight digits that doesn’t look like a year.
It recognizes the word for “code” in several languages, including Spanish, Italian, Russian, Chinese, Japanese and Korean, so a text from an app set to another language still works.
For developers and AI agents
If you are writing a test or an agent that signs in somewhere, you don’t need to parse texts yourself. Every text that arrives on one of our numbers already has its code extracted this way: the REST API returns the code as its own field beside the full message, and the MCP server’s wait_for_code tool hands it to the agent directly.
The full message always comes back too. When the extractor declines to guess, your code or your agent can read the text and decide.
Questions people ask
- Is the text I paste sent anywhere?
- No. The extractor is JavaScript running in your browser. Nothing you paste is sent to a server or stored.
- Why did it return nothing for my message?
- Either the message has no verification code, or it has more than one number that could be the code and nothing that labels one of them. The extractor is built to return nothing in that case, because pasting a wrong code can lock an account after a few tries.
- Does it work with codes that contain letters?
- Yes, when the code mixes letters and digits and follows a label such as “code:” or “use code”. A plain word after “code” is not treated as a code.
- Can I use a regular expression instead?
- For one known sender, yes: a pattern for that sender’s exact wording is reliable. For texts from many senders, a single pattern picks up prices, dates and short codes. Masking those first, then looking for labels, is what makes the general case work.