Text CAPTCHAs are the oldest kind of challenge and still the most widespread. The server draws a short string (digits, letters, a word or a small sum), warps it, adds noise and crossing lines, and asks the visitor to type it back. Modern versions are usually generated on demand, expire after a few minutes and are tied to the session and IP.
How to identifyLink to How to identify
- Text that is warped, wavy, rotated or scratched
- Random letters and digits, or sometimes a word or a sum
- Lines, dots or noise drawn over the background
- A coloured or gradient background, occasionally framed
- Paths such as
/captcha,/securimage,/simple-captcha,/kcapor/captcha.php - An image response (
image/png,image/jpeg,image/gif) or base64 inside JSON
Common variantsLink to Common variants
| Variant | Example | Notes |
|---|---|---|
| Digits only | 482913 |
The easiest; a fixed length makes segmentation simple |
| Alphanumeric | aB3xK9 |
Watch out for case sensitivity |
| Dictionary words | orange |
Small vocabulary, often case-insensitive |
| Math tasks | 7 + 4 = ? |
Read the expression, then work it out |
| Animated GIF | frames with moving noise | Keep the sharpest frame, or average them |
| Handwritten / 3D | stylised glyphs | Much tougher for classic OCR |
| Emoji / icon selection | "pick the cat" | Really an image-recognition CAPTCHA |
How it works (briefly)Link to How it works (briefly)
- The server picks a random answer and keeps it in the session, or signs it into a token.
- It draws an image of that answer and sends it to the browser.
- The visitor types the text, the server compares it with what it stored, and normally discards it.
- Many implementations also check the session cookie, the referer and how long the submission took.
So OCR alone doesn't always cut it. You also need to stay in the same session, submit reasonably fast and use each answer exactly once.
Free & open-source bypass methodsLink to Free & open-source bypass methods
| Tool | What it does | Success Rate | Link |
|---|---|---|---|
| ddddocr | The best place to start: works out of the box, no training | 90-99% (simple) | sml2h3/ddddocr |
| EasyOCR | Multilingual OCR with a simple API | 70-90% | JaidedAI/EasyOCR |
| PaddleOCR | Handles complex, noisy text well, with many pretrained models | 80-95% | PaddlePaddle/PaddleOCR |
| Tesseract | Classic OCR that needs preprocessing and a whitelist | 50-80% | tesseract-ocr/tesseract |
| MMOCR | OpenMMLab's toolbox for detection and recognition pipelines | 80-98% | open-mmlab/mmocr |
| TrOCR | Transformer-based OCR on Hugging Face | 85-98% | microsoft/trocr-base-printed |
| captcha_trainer | Trains a model on the exact CAPTCHA you target | 95-99% (trained) | kerlomz/captcha_trainer |
| CRNN baseline | A light CNN + RNN + CTC recogniser | 80-95% | meijieru/crnn.pytorch |
| OpenCV | Preprocessing, segmentation and template matching | — | opencv/opencv-python |
| YOLOv8 | Detects or segments characters and challenge objects | 85-98% | ultralytics/ultralytics |
| Buster | A browser extension that also helps with audio fallbacks | 70-90% | dessant/buster |
These figures are ballpark numbers for ordinary text CAPTCHAs. Images built specifically to defeat OCR (heavy warping, adversarial noise, animated backgrounds) bring accuracy down sharply and generally call for a custom-trained model.
Preprocessing tricks to boost OCRLink to Preprocessing tricks to boost OCR
- Go to grayscale, then apply an adaptive threshold (Otsu or adaptive Gaussian) to drop the background.
- Straighten the text, estimating the angle with
minAreaRector Hough lines. - Use morphology: dilate or erode to rejoin broken strokes, and an opening to wipe out thin noise.
- Smooth speckles with a median or Gaussian blur, or a bilateral filter if you want to keep edges sharp.
- Strip long lines with morphological operations or a Hough transform before running OCR.
- Upscale 2 to 4 times with Lanczos, keeping the aspect ratio.
- Invert the colours when the text is lighter than the background.
- When characters are well spaced, split them with a vertical projection and read them one by one.
- Limit the alphabet (
tessedit_char_whitelist,-c tessedit_char_whitelist=...) to the characters the site really uses. - Run several preprocessing variants and keep the most confident result instead of trusting a single pass.
Training your own modelLink to Training your own model
- Generate 2,000 to 5,000 synthetic samples with fonts and noise close to the target.
- Train with captcha_trainer, MMOCR, or your own CRNN in PyTorch or TensorFlow.
- Use CTC loss for strings of varying length, and augment with elastic distortion, blur, salt-and-pepper noise, random lines, rotation and perspective.
- Balance the alphabet, or look-alike characters (0/O, 1/l/I) will account for most of the errors.
- Export to ONNX or TensorRT for fast inference.
- For session-bound CAPTCHAs, train on images from the same renderer, not on screenshots from a different site.
Vision-LLM approach (when allowed)Link to Vision-LLM approach (when allowed)
Today's multimodal models (GPT-4o, Gemini, Claude) can read many simple text CAPTCHAs. They are slow and fairly expensive per call, but handy for small volumes and for labelling a training set quickly. Check the target site's terms and the model provider's usage policy first.
Cloud / vision APIs (when allowed)Link to Cloud / vision APIs (when allowed)
| Service | Notes |
|---|---|
| Google Cloud Vision | Good with warped text; billed per use |
| AWS Textract | Broad language coverage |
| Azure Read | Dependable on printed text |
| GPT-4o / Gemini Vision | Vision models that handle many simple text CAPTCHAs |