Free OCR API: image to text from a web page, no backend
Is there a free OCR API that turns an image into text without a server?
Yes. OneTag AI reads images with a vision model, and each email address gets a key with 1,000,000 free tokens a month and no credit card. In our tests a full page of text cost about 2,200 tokens, so the free key reads about 450 full-page images a month, or about 1,900 small ones such as receipts. The key is safe to leave in page source, so the page itself can send a photo and get the text back, with no backend.
It returns plain text, or JSON in the shape you ask for. It does not return word positions and it does not read PDFs; the comparison below lists the free OCR APIs that do.
Steps
Get a free key
Enter your email at onetagai.com. The key (it starts with
ot_) arrives by email. One key per email, no card.Read the text in an image
Pass the image file as the input. The script scales it down to at most 1,600 pixels on the long side before it is sent:
<input type="file" id="photo" accept="image/*"> <pre id="text"></pre> <script src="https://onetagai.com/v1.js" data-key="YOUR_ONETAG_KEY"></script> <script type="module"> const photo = document.getElementById("photo"); photo.onchange = async () => { document.getElementById("text").textContent = await onetag.ask( "Transcribe all the text in this image exactly. Keep the line breaks. Return only the text.", photo.files[0], { maxTokens: 2000 } ); }; </script>The input can also be an
<img>element that is already on the page.Get fields instead of text
Describe the JSON you want and set
json: true. The answer is a parsed object:const receipt = await onetag.ask( 'Read this receipt. Return JSON {"merchant": string, "date": "YYYY-MM-DD", "total": number, "items": [{"name": string, "price": number}]}.', photo.files[0], { json: true, maxTokens: 1000 } ); console.log(receipt.merchant, receipt.total, receipt.items);Or call it over HTTP
From a server or a script, send the image as a base64 data URL. Python needs only the standard library:
import base64, json, urllib.request image = base64.b64encode(open("receipt.jpg", "rb").read()).decode() body = { "key": "YOUR_ONETAG_KEY", "prompt": "Transcribe all the text in this image exactly. Keep the line breaks. Return only the text.", "input": [{"type": "image", "data_url": "data:image/jpeg;base64," + image}], "max_tokens": 2000, } req = urllib.request.Request( "https://onetagai.com/v1/ask", data=json.dumps(body).encode(), headers={"Content-Type": "application/json"}, ) with urllib.request.urlopen(req) as res: print(json.load(res)["text"])
What we measured
Both tests ran against the live API on 2026-11-10, with images we generated so the right answer was known.
| Image | Result | Tokens used | Time |
|---|---|---|---|
| A printed page, 1,600 × 1,200 pixels, 13 lines, 1,221 characters | Every character matched | 2,235 (1,972 in, 263 out) | about 5 s |
| A printed receipt, 900 × 420 pixels, 6 lines, as text | Every character matched | 515 (436 in, 79 out) | about 3.5 s |
| The same receipt, as JSON with merchant, date, total and items | All fields correct | 564 (464 in, 100 out) | about 2 s |
These were clean, printed, high-contrast images. Handwriting, blurry photos and very small print are harder: test with your own images before you rely on it.
Free OCR APIs compared
| API | Callable from a public page, no backend | Free allowance | What you need to start |
|---|---|---|---|
| OneTag AI | Yes. The key is public by design and can only spend its own budget | 1,000,000 tokens a month, reset on the 1st: about 450 full-page images or 1,900 small ones in our tests | An email address. No card |
| OCR.space | Yes. Their docs include a browser example; the key is then visible in the page | 25,000 requests a month, files up to 1 MB, PDFs up to 3 pages, 500 requests a day per IP address | A free API key |
| Tesseract.js | Yes. The OCR engine itself runs in the browser through WebAssembly, with no API and no key. It does not read PDFs | Free and open source. It runs on the visitor's device, so no provider quota applies | Nothing. It is a JavaScript library |
| Google Cloud Vision | Built for server code: setup goes through a Google Cloud project and the gcloud CLI | The first 1,000 units a month; then $1.50 per 1,000 for text detection | A Google Cloud project with billing enabled |
| Azure AI Vision | Not safely. Calls carry a secret resource key | 5,000 transactions a month on the free F0 tier, 20 a minute | An Azure subscription |
| Amazon Textract | Built for server code inside an AWS account | 1,000 pages a month of text detection for the first three months, for new AWS customers | An AWS account |
Other providers' figures were read on their own pages on 2026-11-10; follow the link in each row for the current numbers. Free tiers change often.
Which free OCR API should you use?
- You want fields, not raw text (the total on a receipt, the name on a card), from a static page: OneTag AI. You describe the JSON and get it back in one call.
- Images must stay on the visitor's device, or you need no quota at all: Tesseract.js. It runs in the browser; the trade is a larger download and weaker results on photos.
- You need PDFs or many small scans: OCR.space. 25,000 requests a month, and it accepts PDFs up to 3 pages on the free plan.
- You need word positions, or you process documents at volume on a server: Google Cloud Vision, Azure AI Vision or Amazon Textract.
Limits to know before you rely on it
- One image per call. In the browser the script resizes it first, so a large phone photo is fine; over HTTP the image can be up to 2 MB. PDFs do not work.
- No word positions or bounding boxes, and no confidence scores.
- It is a vision model, not a classic OCR engine. It can misread a blurry digit, or tidy up a typo it should have copied. For numbers that matter, such as invoice totals, show the result to the user to confirm.
- Answers are 500 tokens long by default. Set
maxTokens(max_tokensover HTTP) to 2,000 or more for a full page, up to 10,000. - 60 requests a minute per key and 20 a minute per IP address.
Questions
Is the OCR API really free?
Yes, up to 1,000,000 tokens a month per key, with no credit card. The allowance starts again on the 1st of each month (UTC). If a month's tokens are used up, calls return quota_exceeded until the 1st, or until you upgrade to Pro ($9.9 a month for 100,000,000 tokens a month).
How many images can I read for free?
It depends on the size of the image and the amount of text. In our tests a full page at 1,600 × 1,200 pixels used 2,235 tokens and a small receipt 515, so 1,000,000 tokens is about 450 full pages or about 1,900 receipts a month.
Does it read PDFs?
No. It reads one image per call. Convert the page to an image first, or use an API that takes PDFs, such as OCR.space.
Does it read handwriting?
Vision models can read clear handwriting, but we have not measured it, so test with your own samples. Printed text in our tests came back with every character right.
Does it return bounding boxes or word coordinates?
No. It returns the text, or JSON in the shape you ask for. For coordinates use Google Cloud Vision, Azure AI Vision or Amazon Textract.
Can I extract data from a receipt or an invoice as JSON?
Yes. Describe the fields in the prompt and set json: true, for example {"merchant": string, "date": "YYYY-MM-DD", "total": number}. In our receipt test all fields came back correct.
Are the images stored?
No. The image goes to the model and the answer comes back. OneTag AI stores token counts per key for the quota and keeps no prompts, inputs or answers.
Is it safe to put the OneTag AI key in my page?
Yes, it is designed for that. The key can only spend its own token budget and cannot read or change anything on your account. On the Pro plan you can lock it to your domain so other sites cannot use it; free keys work from any page.
Related guides
- Free AI API for websites: no backend, no credit card
- Free translation API for websites: no backend, no credit card
- Free chatbot API for websites: chat history, streaming, no backend
- Is it safe to put an AI API key in a static HTML page?
Get a free key by email, paste one tag, call onetag.ask. 1,000,000 tokens a month, no card.
Updated 2026-11-11. Something wrong or missing? Email support@odysseyx.app.