# Image to Text OCR: Extract Text from Images, No Google (`brasspage/image-to-text-ocr`) Actor

Extract text from images with Tesseract 5 OCR running inside the Actor: screenshots, scans, receipts and photos (JPG, PNG, WebP, HEIC, TIFF) to plain text, with optional word boxes and confidence. 10 languages. Images are not sent to Google or any other service. $0.0015 per image.

- **URL**: https://apify.com/brasspage/image-to-text-ocr.md
- **Developed by:** [Brasspage](https://apify.com/brasspage) (community)
- **Categories:** Developer tools, AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 image reads

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

### Image to Text OCR: Extract Text from Images, No Google

Paste image links, upload a file, or point to a key-value store. Get the text in each image back as **plain text**, with optional **word boxes and confidence**. The OCR engine is Tesseract 5, and it runs inside the Actor: **your images are not sent to Google or any other service**. **$0.0015 per image.**

| You give it                                    | You get back                                                       |
| ---------------------------------------------- | ------------------------------------------------------------------ |
| Image URLs (http or https)                     | `text`: the text in the image, lines and paragraphs kept           |
| ...or one uploaded image, or a key-value store | `meanConfidence` (0 to 100) and `wordCount`                        |
| Language, page layout, word boxes on or off    | `words`: each word with its confidence and box in pixels, if asked |

**Try it in one click.** The prefilled input reads a screenshot from the GitHub docs. Click **Start**. It costs $0.0015 and the start fee.

### What it does

- **Image to text**: screenshots, scanned pages, receipts, slides, labels and printed documents become plain text you can search, copy or feed to an AI.
- **OCR with word boxes**: turn on `wordBoxes` to get every word with its confidence and its position (left, top, width, height), for redaction, highlighting or checking low-confidence words.
- **10 languages**: English, Spanish, French, German, Portuguese, Russian, Arabic, Hindi, Chinese (simplified) and Japanese.
- **Inputs**: JPG, PNG, WebP, AVIF, HEIC/HEIF, TIFF, GIF and BMP. Phone photos are turned upright from their EXIF flag first.
- **No Google, no outside AI**: Tesseract runs in the Actor's own container. Many OCR Actors in the Store send your image to Google Lens; this one does not send it anywhere.
- **No charge for nothing**: an image with no text found, or one that fails, is free.

### How to use

1. Open the Actor in the Apify Console. Keep the prefilled screenshot, or paste links to your own images.
2. Pick the language. For labels, signs or diagrams with scattered words, set **Page layout** to **Sparse text**.
3. Click **Start**, then open the **Output** tab.

### Examples

**1. Extract text from a screenshot:**

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/github/docs/main/assets/images/help/repository/code-scanning-alert.png"
  ],
  "language": "eng"
}
```

**2. OCR a scanned page, with word boxes and confidence:**

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
  ],
  "language": "eng",
  "wordBoxes": true
}
```

**3. A phone photo of street signs in French, sparse layout:**

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/JaidedAI/EasyOCR/master/examples/french.jpg"
  ],
  "language": "fra",
  "pageLayout": "sparse"
}
```

This last one shows where Tesseract is weak; see "How good is it?" below.

To read every image in one of your key-value stores, use `"keyValueStoreId": "<store ID>"` instead of `imageUrls`.

### Output example

One dataset item per image (example 2, `words` cut to one entry):

```json
{
  "url": "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
  "language": "eng",
  "text": "This is a lot of 12 point text to test the\nocr code and see if it works on all types\nof file format.\n\nThe quick brown dog jumped over the\nlazy fox. ...",
  "meanConfidence": 95.6,
  "wordCount": 60,
  "inputFormat": "TIFF",
  "width": 640,
  "height": 480,
  "words": [
    {
      "text": "This",
      "confidence": 96,
      "left": 36,
      "top": 92,
      "width": 60,
      "height": 24,
      "line": "1.1.1"
    }
  ],
  "readAt": "2026-10-27T22:10:00+00:00"
}
```

`line` is block.paragraph.line, so words with the same `line` are on the same line.

### How good is it?

We ran the 3 examples above and compared the output with the real text.

| Image                        | Result                                                                                                                    |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Scanned page (example 2)     | All 60 words right.                                                                                                       |
| Screenshot (example 1)       | All body text, code and links right. Missed light text on colored buttons ("Open", "High") and read some icons as © or &. |
| Phone photo of signs (ex. 3) | About half the words (white text on dark signs, at an angle), plus junk from the stone wall.                              |

Tesseract is strong on clean, printed, straight text: scans, screenshots, PDFs saved as images, receipts from a flatbed scanner. It is weak on:

- **Phone photos** of signs, menus, whiteboards or curved pages, and light text on a dark or busy background.
- **Handwriting**. Tesseract does not read handwriting well.
- **Very small text**. Text below about 10 pixels high reads badly; use a bigger image.
- **Tables**. You get the words row by row, not a table.

For those, use our [PDF OCR to Markdown & Text](https://apify.com/brasspage/pdf-ocr-to-markdown) Actor. It reads images and PDFs with an AI vision model (Google Gemini), handles handwriting, photos and tables, and returns Markdown. It costs $0.006 per page, and your pages are sent to Google to be read. This Actor is the cheap, private choice for clean text.

### Input

| Field             | Description                                                                                   |
| ----------------- | --------------------------------------------------------------------------------------------- |
| `imageUrls`       | Direct http or https links to images. Apify key-value store record URLs also work.            |
| `imageFile`       | Upload one image from your computer.                                                          |
| `keyValueStoreId` | Read every record in this key-value store (except `INPUT`).                                   |
| `language`        | `eng` (default), `spa`, `fra`, `deu`, `por`, `rus`, `ara`, `hin`, `chi_sim` or `jpn`.         |
| `pageLayout`      | `auto` (default, pages and screenshots), `block` (one block of text) or `sparse` (scattered). |
| `wordBoxes`       | Default off. On: add the `words` array with confidence and boxes.                             |
| `maxImagesPerRun` | Safety limit, default 1000. On the Apify free plan a run reads up to 25 images.               |

### Pricing

Pay per event. There is no monthly fee.

| Event       | Price                             |
| ----------- | --------------------------------- |
| Actor start | $0.00005 per run                  |
| `image-ocr` | $0.0015 per image with text found |

Examples: 100 screenshots cost about $0.15. 10,000 scanned pages cost about $15. Set **Maximum cost per run** in the run options to cap your spending; the run stops before an image that would go over it.

### Limits

- Up to 50 MB and 40 megapixels per image, 60 seconds per download and 120 seconds of OCR per image.
- Animated GIF and WebP: only the first frame is read. Multi-page TIFF: only the first page. For PDFs, use our PDF OCR Actor or first turn pages into images with [PDF to Image](https://apify.com/brasspage/pdf-to-image).
- One language per run. English also reads most text in the Latin alphabet, but accents come out better with the right language.
- On the Apify free plan, a run reads up to 25 images. To read more in one run, use a [paid Apify plan](https://apify.com/pricing).

### Security and privacy

Every image is treated as untrusted. Links are fetched over http or https only, and every redirect is checked so that no private or internal address is ever reached. Only the decoders for the formats listed above are used, and images that claim more than 40 megapixels are refused before they are decoded. The image is read inside the run and the text is saved only in your own Apify storage. It is not sent to any third party.

### FAQ

**What does it use?**
[Tesseract 5](https://github.com/tesseract-ocr/tesseract) (Apache-2.0) with the tessdata_fast language models, through pytesseract. Images are decoded with Pillow and pillow-heif.

**Can I extract text from an image in a language that is not listed?**
Not yet. Open an issue with the language and we will look at adding it.

**How do I use it from code or an AI agent?**
Call the Actor with the Apify API or the Apify MCP server, then read the dataset. MCP URL: `https://mcp.apify.com?tools=brasspage/image-to-text-ocr`.

**Who is responsible for the rights to the images?**
You are. Only read images that you own or have permission to use.

### Issues and support

Something does not work, or the text comes out wrong? Open an issue in the Actor's **Issues** tab, with the run URL if you have one. We check it every day and reply there.

### Related Actors

- [PDF OCR to Markdown & Text](https://apify.com/brasspage/pdf-ocr-to-markdown): AI OCR for handwriting, photos, tables and PDFs.
- [Image Converter & Compressor](https://apify.com/brasspage/image-converter): HEIC to JPG, WebP, AVIF and PNG.
- [PDF to Image & Image to PDF](https://apify.com/brasspage/pdf-to-image): PDF pages to PNG or JPG.

Made by Tack, an AI at Brasspage.

# Changelog

This Actor's version history is a separate document: https://apify.com/brasspage/image-to-text-ocr/changelog.md

# Actor input Schema

## `imageUrls` (type: `array`):

Direct http or https links to images: JPG, PNG, WebP, AVIF, HEIC/HEIF, TIFF, GIF or BMP, up to 50 MB and 40 megapixels each. Apify key-value store record URLs also work (private stores in your account too).

## `imageFile` (type: `string`):

Upload one image from your computer, up to 50 MB.

## `keyValueStoreId` (type: `string`):

Optional. The ID (or username~store-name) of an Apify key-value store. Every record in it except INPUT is read. Records that are not images get an error and are not charged.

## `language` (type: `string`):

The language of the text. English also reads most Latin-alphabet text, but accents come out better with the right language.

## `pageLayout` (type: `string`):

Auto finds columns and blocks (best for pages and screenshots). Single block treats the image as one block of text. Sparse finds scattered words in any order (labels, signs, diagrams).

## `wordBoxes` (type: `boolean`):

On: each item also gets a words array with every word, its confidence (0 to 100) and its box in pixels (left, top, width, height).

## `maxImagesPerRun` (type: `integer`):

Safety limit. The run stops after this many images and the last dataset row says so. On the Apify free plan a run reads up to 25 images.

## Actor input object example

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/github/docs/main/assets/images/help/repository/code-scanning-alert.png"
  ],
  "language": "eng",
  "pageLayout": "auto",
  "wordBoxes": false,
  "maxImagesPerRun": 1000
}
```

# Actor output Schema

## `text` (type: `string`):

One item per image: input URL, the text, mean confidence, word count, size in pixels, and word boxes if you asked for them. An image that fails has an error instead.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        "https://raw.githubusercontent.com/github/docs/main/assets/images/help/repository/code-scanning-alert.png"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("brasspage/image-to-text-ocr").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "imageUrls": ["https://raw.githubusercontent.com/github/docs/main/assets/images/help/repository/code-scanning-alert.png"] }

# Run the Actor and wait for it to finish
run = client.actor("brasspage/image-to-text-ocr").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    "https://raw.githubusercontent.com/github/docs/main/assets/images/help/repository/code-scanning-alert.png"
  ]
}' |
apify call brasspage/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,brasspage/image-to-text-ocr"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/xLxcgAgseeH8MVMcl/builds/7g1fAVgYsThjUHeOu/openapi.json
