Skip to main content

CAPTCHA guide

Text-Based CAPTCHAs

Warped letters and digits that modern OCR reads with little effort.

Difficulty: Low
Text & audio
Exploded concept drawing of how the Text-based CAPTCHA challenge is built

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, /kcap or /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)

  1. The server picks a random answer and keeps it in the session, or signs it into a token.
  2. It draws an image of that answer and sends it to the browser.
  3. The visitor types the text, the server compares it with what it stored, and normally discards it.
  4. 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 minAreaRect or 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

Skip the solver: let BrowserSolver handle Text-based CAPTCHA

Website AntiBot runs a real browser session with matching TLS, headers, cookies and IP, clears the challenge, and returns the page. You send a URL, you get HTML back.

For education and authorized testing only. Respect the law, privacy, and the terms of the sites you work with. Difficulty labels are editorial estimates. Adapted from the CC0 community field guide on GitHub.