A free image to text API, tested
84.6%
of 7,083 words read in order by rapidocr_api
rapidocr_api led the 3 free servers
| Server | All | Scans | Photos | Screens | Sideways |
|---|---|---|---|---|---|
| rapidocr_api | 84.6% | 97.3% | 97.4% | 100% | 49.4% |
| docTR API, fast_base | 75.7% | 95.4% | 58.8% | 97.6% | 59.1% |
| docTR API | 64.1% | 92.4% | 49.5% | 64.9% | 49.9% |
| Tesseract server | 49.1% | 96.0% | 31.9% | 79.4% | 0.6% |
| Our Actor's code (paid, no HTTP) | 93.8% | 96.2% | 93.6% | 96.3% | 90.0% |
The same 40 JPGs as our JPG to text test: 10 book scans, phone photos of them, 10 screenshots, and the photos again, stored sideways.
rapidocr_api and docTR are open source (Apache-2.0), and the Tesseract server is our free 53-line sample. Our Actor is paid. Its row is its code, run on the same Mac without HTTP.
rapidocr_api in 3 commands
pip install rapidocr_api onnxruntime
rapidocr_api -ip 127.0.0.1 -p 9003
curl -F [email protected] http://127.0.0.1:9003/ocr | jq -r '.[].rec_txt'
- Leave out onnxruntime and the server still starts, then answers every image with 500 Internal Server Error.
-
Without
-ip 127.0.0.1it listens on every network, with no key. Add a proxy with a token before it goes online. - The reply has one entry a line: the text, its box and a score. The models (31.7 MB) come in the pip package.
Turn phone photos upright first
A phone often stores a photo sideways, with a tag that says which way is up. rapidocr_api does not read the tag. It found 87.8% of the words on those photos, but only 49.4% in reading order.
from PIL import Image, ImageOps
ImageOps.exif_transpose(Image.open("photo.jpg")).save("upright.jpg", quality=95)
Turned upright first, the same photos came back at 97.4%. The RapidOCR library reads the tag when you give it a file path.
docTR's API: add ?det_arch=fast_base
git clone --branch v1.1.0 https://github.com/mindee/doctr
pip install python-doctr==1.1.0 fastapi uvicorn python-multipart
uvicorn app.main:app --app-dir doctr/api --host 127.0.0.1 --port 8080
curl -F [email protected] "http://127.0.0.1:8080/ocr/?det_arch=fast_base"
- Its default text finder is db_resnet50, not the library's fast_base. On screenshots it ran words together ("Islept"): 64.9%, against 97.6%.
- With fast_base it found 94.7% of the words on phone photos, but only 58.8% in reading order.
-
Keep the slash in
/ocr/. Without it, the server answers 307. - Each call builds the models again: 3 to 4 seconds here.
-
Debug is on unless you start it with
DEBUG=False. An empty request got a Python traceback with file paths.
What a wrong file gets back
| File sent | rapidocr_api | docTR API | Tesseract server |
|---|---|---|---|
| No file | 500 | 500 | 413 |
| A .txt file | 500 | 400 | 422 |
| Text named .jpg | 500 | 400 | 422 |
| WEBP | 200 | 400 | 200 |
| HEIC | 500 | 400 | 422 |
| 500 | 200 | 422 |
All 3 read PNG. Only docTR's API reads a PDF. rapidocr_api gives a bare 500 with no reason, so check the file type first.
Tesseract is small, docTR is big
| Server | Install | Seconds |
|---|---|---|
| rapidocr_api | 283 MB, models inside | 5.8 |
| docTR API | 1,066 MB + 165 MB of models | 11.7 |
| Tesseract server | 53 lines + Tesseract | 1.8 |
Highest RAM after a call: rapidocr_api 1.6 GiB, docTR's API 2.7 GiB, or 3.7 GiB with fast_base. One call at a time, on a busy Mac, so the seconds are rough.
No server: our Actor
PDF OCR to Markdown, our Apify Actor, takes a JPG, PNG, WEBP, TIFF or HEIC by URL and returns its text. Its code found 93.8% of these words.
- It reads the sideways tag: 90.0% on those photos. On scans, photos and screenshots, rapidocr_api found more.
- An image costs $0.006, plus $0.00005 to start each run, with an Apify token. The call is on PDF OCR API.
What I did not test
- Docker images, GPUs, and many calls at once.
- Cloud APIs. Prices are on OCR pricing.
- PaddleOCR's own server, handwriting, and scripts other than Latin.
How I tested it
- The 40 JPGs: book pages proofread on Wikisource, made-up phone photos of them, light-mode screenshots, and the photos stored turned with EXIF Orientation 6.
- 10 files in each set, 7,083 words in all.
- Score: a true word counts if the reply has it, spelled the same, in reading order. Curly quotes count as straight ones.
- rapidocr_api 0.2.0, RapidOCR 3.10.0, onnxruntime 1.31.1.
- docTR 1.1.0 and its api folder at tag v1.1.0, on Python 3.12.
- Tesseract 5.5.4, on macOS 26.6.
- The Tesseract server is the 53-line one on Tesseract OCR API. It gave the same text as the Tesseract command on all 40 files.
- Our Actor's code is build 0.1.141, run on our Mac.
- Scripts and results stay in our private repo, in research/bench/image-to-text-api-2026-11-25/.
Sources
- RapidOCRAPI and RapidOCR
- docTR's api folder and docTR
- Tesseract
- We make the Apify Actor and the 53-line Tesseract server, and none of the other tools here.
Questions people ask
Is there a free image to text API?
Yes, if you run it yourself. rapidocr_api is free and open source (Apache-2.0) and found 84.6% of the words in our 40 JPGs, in reading order. OCR.space has a free hosted key, with limits.
Which open-source OCR API found the most words?
In reading order, rapidocr_api: 84.6%. In any order, docTR's API with ?det_arch=fast_base found about as many, but mixed up the order on photos. The Tesseract server read scans well, not phone photos.
Why does my phone photo come back jumbled?
The phone stored it sideways, with a tag that says which way is up. rapidocr_api and the Tesseract server did not read the tag. Turn the photo upright before you send it.
Related guides
- Self-hosted OCR: 4 Docker servers tested on one scan
- Tesseract OCR API: no key needed, a REST API in 53 lines
- OCR.space API: free key limits, the demo key and engine 2 on 10 scans
- JPG to text converter: 5 OCR readers tested on 40 JPGs
- RapidOCR in Python: tested vs Tesseract and PaddleOCR
- docTR OCR on a scanned PDF: Mac setup and results, tested