# Image to Text OCR: Extract Text from Images (26 Languages) (`tidelane/image-to-text-ocr`) Actor

Extract text from images, scans, screenshots and photos with Tesseract OCR in 26 languages. Auto-rotates sideways scans, upscales small screenshots, reads multi-page TIFFs and returns text, confidence and optional line and word boxes.

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

## Pricing

from $0.70 / 1,000 images

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 (26 Languages)

Extract text from **images, scans, screenshots and photos of documents**. Paste image links and get back the text of each image, a confidence score and, if you want, every line and word with its position. Built on Tesseract 5 with smart preprocessing, so you don't have to clean up images first.

- ✅ **26 languages**: English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Czech, Slovak, Swedish, Danish, Norwegian, Finnish, Turkish, Russian, Ukrainian, Romanian, Hungarian, Greek, Chinese (simplified and traditional), Japanese, Korean, Arabic, Hindi
- ✅ **Auto-rotate**: sideways and upside-down scans are turned upright before reading
- ✅ **Small text works**: screenshots and small crops are upscaled automatically (Tesseract reads best at about 300 DPI)
- ✅ **All common formats**: PNG, JPEG, WebP, BMP, GIF and **multi-page TIFF** (one result per page), transparent PNGs, 16-bit scans, phone photos with EXIF rotation
- ✅ **Positions**: optional line and word boxes (x, y, width, height) with a confidence each, for redaction, highlighting or form parsing
- ✅ **Batches**: paste many links, several images are read in parallel
- ✅ **Fair billing**: you pay per image read; broken links, non-images and failed images are free

### Input example

```json
{
    "imageUrls": ["https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"],
    "languages": ["eng"],
    "layout": "auto",
    "autoRotate": true,
    "outputDetail": "lines"
}
```

| Field | What it does |
|---|---|
| `imageUrls` | Direct links to images (up to 40 MB and 60 megapixels each) |
| `languages` | Language codes such as `eng`, `deu`, `chi_sim`; several at once work |
| `layout` | `auto` for documents, `sparse` for screenshots and photos with scattered text, `block` or `line` for a single block or line |
| `autoRotate` | Turn sideways scans upright (default on) |
| `outputDetail` | `text`, `lines` (with boxes) or `words` (lines plus every word with its box) |

### Output example

Real output from a test run (`lines` shortened to the first two):

```json
{
    "url": "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif",
    "fileName": "phototest.tif",
    "page": null,
    "width": 640,
    "height": 480,
    "rotation": 0,
    "languages": ["eng", "nld", "hin"],
    "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. The quick brown dog jumped\nover the lazy fox. The quick brown dog\njumped over the lazy fox. The quick\nbrown dog jumped over the lazy fox.",
    "confidence": 95.3,
    "wordCount": 60,
    "charCount": 285,
    "lines": [
        { "text": "This is a lot of 12 point text to test the", "confidence": 95.4, "box": { "x": 36, "y": 92, "w": 544, "h": 30 } },
        { "text": "ocr code and see if it works on all types", "confidence": 95.3, "box": { "x": 36, "y": 126, "w": 582, "h": 31 } }
    ]
}
```

Line breaks follow the image; paragraphs are separated by a blank line. `page` is set for multi-page TIFFs and animated GIFs. `rotation` tells you by how many degrees the image was turned. A summary per link (`ok` or `error` with the reason) is saved as `OUTPUT` in the key-value store.

### Pricing

You pay per image (per page for multi-page TIFFs). In our tests 4 images from 0.3 to 11 megapixels in 3 languages took 11 seconds with the default 1 GB memory. In longer runs Apify limits the CPU to the run's share of memory: 36 text-heavy images (12 megapixel document photos, screenshots and receipts) took about 9 minutes with 1 GB. More memory means more CPU, so long runs finish sooner; the price per image stays the same.

Paid Apify plans pay less: 10% off on Starter, 20% on Scale and 30% on Business and higher plans.

### FAQ

**Which languages should I pick?** Only the ones in your images. Each extra language makes reading slower and can lower accuracy, for example by mixing up similar letters.

**Does it read handwriting?** Clear block letters often work; cursive handwriting does not. Tesseract is made for printed text.

**My images are PDFs.** Use our PDF to Markdown & Text Actor: it reads the text layer directly and only OCRs scanned pages.

**What does the confidence mean?** The average certainty of Tesseract per word from 0 to 100. Above 85 is usually clean text; below 60 the image is likely blurry, very small or handwritten.

### More tools from Tidelane Data

- [PDF to Markdown](https://apify.com/tidelane/pdf-to-markdown): PDFs to Markdown and text, with tables and OCR for scans
- [Audio & Video to Text](https://apify.com/tidelane/audio-video-transcriber): speech to text transcription with Whisper
- [AI Image Upscaler](https://apify.com/tidelane/ai-image-upscaler): upscale images 2x, 3x or 4x with Real-ESRGAN
- [Bulk Image Downloader](https://apify.com/tidelane/bulk-image-downloader): all images from web pages, also as one ZIP

All our tools: [apify.com/tidelane](https://apify.com/tidelane)

***

#### Impressum

Levi Griesinger, Tidelane Data\
Besigheimer Straße 18\
74369, Löchgau, Deutschland\
E-Mail: LeviGriesinger@gmail.com

# Actor input Schema

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

Direct links to images, one per line: PNG, JPEG, WebP, TIFF (also multi-page), BMP or GIF, up to 40 MB and 60 megapixels each.

## `languages` (type: `array`):

Languages of the text. Allowed: eng, deu, fra, spa, ita, por, nld, pol, ces, slk, swe, dan, nor, fin, tur, rus, ukr, ron, hun, ell, chi_sim, chi_tra, jpn, kor, ara, hin. Several are fine, fewer are faster.

## `layout` (type: `string`):

Use 'Sparse text' for screenshots and photos where text is scattered.

## `autoRotate` (type: `boolean`):

Detect sideways or upside-down scans and turn them upright before reading.

## `outputDetail` (type: `string`):

Boxes are pixel coordinates (x, y, w, h) in the upright image, with a confidence per line and word.

## Actor input object example

```json
{
  "imageUrls": [
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
  ],
  "languages": [
    "eng"
  ],
  "layout": "auto",
  "autoRotate": true,
  "outputDetail": "text"
}
```

# Actor output Schema

## `results` (type: `string`):

All results of the run as dataset items.

## `summary` (type: `string`):

Summary per input with status (ok, error and the reason).

# 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/tesseract-ocr/test/main/testing/phototest.tif"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tidelane/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/tesseract-ocr/test/main/testing/phototest.tif"] }

# Run the Actor and wait for it to finish
run = client.actor("tidelane/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/tesseract-ocr/test/main/testing/phototest.tif"
  ]
}' |
apify call tidelane/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tidelane/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/vo5FHKq93ySzzsK6N/builds/4PhO0e7hpI6dqznoM/openapi.json
