# Extract text from scanned images with OCR

**Use case:** 

Reads text from scanned images (PNG, JPEG, TIFF, WEBP) with Tesseract OCR and returns plain text and Markdown per file, with the OCR confidence. Rotated scans are turned upright automatically. 19 languages, up to 5 per run. This example reads a Tesseract test scan.

## Input

```json
{
  "urls": [
    "https://raw.githubusercontent.com/tesseract-ocr/test/main/testing/phototest.tif"
  ],
  "languages": [
    "eng"
  ],
  "ocrMode": "auto",
  "maxPagesPerDocument": 0,
  "includePages": false,
  "removeHeadersFooters": true,
  "autoRotate": true,
  "ocrDpi": 300,
  "maxFileSizeMb": 100
}
```

## Output

```json
{
  "url": {
    "label": "File",
    "format": "string"
  },
  "status": {
    "label": "Status",
    "format": "string"
  },
  "pageCount": {
    "label": "Pages",
    "format": "integer"
  },
  "pagesTextLayer": {
    "label": "Text pages",
    "format": "integer"
  },
  "pagesOcr": {
    "label": "OCR pages",
    "format": "integer"
  },
  "pagesEmpty": {
    "label": "Blank pages",
    "format": "integer"
  },
  "ocrConfidence": {
    "label": "OCR confidence",
    "format": "number"
  },
  "wordCount": {
    "label": "Words",
    "format": "integer"
  },
  "markdown": {
    "label": "Markdown",
    "format": "string"
  },
  "error": {
    "label": "Error",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The PDF & Image OCR to Text and Markdown Actor is ready to run with the inputs already set for "Extract text from scanned images with OCR". [Sign up or log in](https://console.apify.com/create-task-from-example/DkGQ8Lw07T5PLgLKD) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Extract text from scanned images with OCR" task

The PDF & Image OCR to Text and Markdown Actor will start running based on the input automatically. You can also change all the input fields, like file urls, OCR languages, and more, to match your specific use case.

### 3. Receive the "Extract text from scanned images with OCR" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as file, status, pages, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Extract text from scanned images with OCR" task via API](https://apify.com/klarto/pdf-ocr-markdown.md).

## FAQ

### Which image formats does the image OCR task read?

The image OCR task reads PNG, JPEG, TIFF (including multi-page TIFF), WEBP, BMP and the first frame of GIF files from direct links.

### Which languages does the image OCR task support?

The image OCR task supports 19 Tesseract languages, up to 5 per run: English, German, French, Spanish, Italian, Portuguese, Dutch, Polish, Czech, Ukrainian, Russian, Bulgarian and more.

### How much does OCR of one image cost?

OCR of one image costs $0.005, because each image counts as one OCR page. Failed files are free. Apify adds a start event of $0.0001 per run at 2 GB.

### Are my images sent to an outside AI service?

No. The image OCR task runs Tesseract inside the Apify run, so the images are not sent to an outside AI service.

## About this Actor

This example demonstrates how to use [PDF & Image OCR to Text and Markdown](https://apify.com/klarto/pdf-ocr-markdown.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/klarto/pdf-ocr-markdown.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

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 full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/klarto/pdf-ocr-markdown.md

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`).
