# Image to Text OCR - JPG, PNG & Scanned PDF to Text (`neverempty/image-to-text-ocr`) Actor

Extract text from images and scanned PDFs. Paste links to JPG, PNG, TIFF or PDF files (or Google Drive and Dropbox share links) and get clean text for every page, with confidence, word counts and optional word positions. Reads English, Japanese, Chinese, Arabic and many more.

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

## Pricing

from $1.89 / 1,000 page with text extracteds

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 - JPG, PNG & Scanned PDF to Text

Extract text from images and scanned PDFs. Paste links to JPG, PNG, WebP, TIFF, BMP or GIF images, or to PDF files (including scanned PDFs), or Google Drive and Dropbox share links, and get the text of every page as a row.

Each row has the page text with its line breaks, the page number, a confidence score, word, line and character counts, and (if you want it) every word with its position on the page. You pay only for pages that have text: **$2.90 per 1,000 pages**, with no start fee and no charge per file or per megabyte.

### What people use it for

- **Scanned documents to searchable text**: contracts, letters, reports, old archives and books scanned as PDF or TIFF.
- **Receipts, invoices and forms**: get the text out of photos and scans, then pass it to your spreadsheet, database or an AI model to pick out totals, dates and names.
- **Text for AI and search**: turn image-only PDFs into plain text for RAG, summaries, translation or full-text search.
- **Screenshots and product images**: read the text in screenshots, labels, menus, posters and slides.
- **Highlighting and redaction**: turn on word positions to get a box for every word on the page.

### Why use this one

- **Digital PDFs come back exact and fast.** When a PDF page already contains text, that text is used as it is (no reading errors); only pages that are pictures are read as images. You can switch this off for PDFs with broken built-in text.
- **Multi-page files in one go.** Every page of a PDF or a multi-page TIFF becomes its own row with its page number, up to the page cap you set.
- **Many languages, up to 5 per run**, including Japanese, Chinese, Korean, Arabic, Hebrew, Hindi, Thai, Russian and most European languages.
- **Blank pages are skipped and not charged.** Separator sheets and empty backs of scanned pages are left out, and the note says how many.
- **Google Drive and Dropbox links work as they are.** Share the file as "Anyone with the link" and paste the share link.
- **Clear free rows instead of silent gaps.** A link that cannot be read gets one row that says why (not shared publicly, password-protected PDF, web page instead of a file, too large and so on), and is not charged.
- **Confidence per page** so you can send low scores to a person for a second look.

### How to use

1. Paste one or more links into **Image or PDF links**, one per line (leave it empty to try the example: a public-domain scanned press release from the US National Archives).
2. Pick the **Languages in the documents** (English by default). The right language matters most for accents and non-Latin scripts.
3. Optionally set **Max pages per file**, the **PDF pages** mode and **Include every word with its position**.
4. Run. Open the **Output** tab: one row per page with its text. Download all rows as JSON, CSV or Excel.

Tip: if the text of a PDF looks wrong (missing letters, odd symbols), the PDF has broken built-in text. Set **PDF pages** to "Read every page as an image" (`ocr`) and run it again.

#### Input examples

Scanned PDF and two images in English:

```json
{
    "fileUrls": [
        "https://example.com/scan.pdf",
        "https://example.com/receipt.jpg",
        "https://drive.google.com/file/d/FILE_ID/view?usp=sharing"
    ]
}
```

Japanese and English, first 20 pages of each PDF, read every page as an image, with word positions:

```json
{
    "fileUrls": ["https://example.com/report.pdf"],
    "languages": ["jpn", "eng"],
    "maxPagesPerFile": 20,
    "pdfMode": "ocr",
    "includeWords": true
}
```

### Output

One row per page that has text. Example from a scanned 1969 NASA technical report (text shortened here):

```json
{
    "status": "ok",
    "fileUrl": "https://ntrs.nasa.gov/api/citations/19690029423/downloads/19690029423.pdf",
    "fileName": "19690029423.pdf",
    "fileType": "pdf",
    "sourceType": "direct",
    "pageNumber": 9,
    "pageCount": 35,
    "text": "TEST SPECIMENS\n\nBoth a flutter model and a pressure survey model were used in the test\nprogram. The flutter model was a 30-degree segment of the S-IVB forward\nskirt. ...",
    "textSource": "ocr",
    "confidence": 95.8,
    "wordCount": 368,
    "lineCount": 33,
    "characterCount": 2285,
    "languages": "eng",
    "imageWidth": 2406,
    "imageHeight": 3044,
    "words": null,
    "note": null
}
```

| Field | What it is |
|---|---|
| `text` | The page text, with line breaks and blank lines between paragraphs. |
| `textSource` | `ocr` when the page was read as an image, `pdf-text-layer` when the PDF's built-in text was used. |
| `confidence` | Average word confidence from 0 to 100 for pages read as images (empty for built-in PDF text). |
| `wordCount`, `lineCount`, `characterCount` | Counts for the page. |
| `pageNumber`, `pageCount` | The page and the total pages in the file. |
| `imageWidth`, `imageHeight` | Size in pixels of the image (or the rendered PDF page) that was read. |
| `words` | With "Include every word with its position": a list of `{ text, confidence, left, top, width, height }` in pixels. |
| `note` | Anything worth knowing about the file: blank pages skipped, pages not read because of the page cap, and so on. |

#### Free rows (not charged)

When a link cannot be processed, you get one row for it with `status` and a `note` that says why. These rows are free.

| status | What it means |
|---|---|
| `invalid-input` | A setting or a link could not be read (for example an unknown language code). The note says which one. |
| `unsupported-source` | A link to a video or social platform (YouTube, TikTok, Instagram and similar). Use a direct link to the image or PDF file instead. |
| `not-public` | A Google Drive or Dropbox file that is not shared as "Anyone with the link". |
| `unreachable` | The server did not answer, refused the request, or the file does not exist. |
| `not-supported` | The link opens a web page or a file that is not an image or a PDF, or a HEIC/AVIF photo (save it as JPG or PNG first). |
| `too-large` | The file is larger than "Max file size (MB)". |
| `encrypted` | The PDF needs a password to open. |
| `no-text` | No text was found in the file (for example a photo without writing, or only blank pages). |
| `failed` | The file could not be read (for example a damaged image or PDF). |
| `budget-reached` | The run reached the maximum cost you set for it before this file. |
| `time-limit` | The run was close to its timeout before this file. Raise the timeout or run the rest again. |

### Pricing

- **$2.90 per 1,000 pages** ($0.0029 per page returned). An image counts as one page.
- No start fee and no charge per file or per megabyte downloaded.
- Blank pages that are skipped and the free rows above are not charged.
- Set a **maximum cost per run** in the run options and the run reads only as many pages as fit.

Example: 50 scanned PDFs of 20 pages each = 1,000 pages = $2.90.

### Limits

- Printed text reads best. Handwriting is not supported, and vertical Japanese or Chinese text (top to bottom) is not read reliably; use horizontal text.
- Photos taken at an angle, blurry scans and very small print lower the confidence. For small print in PDFs, raise "Scan resolution for PDF pages (DPI)".
- Links to video and social platforms are not downloaded; each gets a free `unsupported-source` row.
- Google Drive and Dropbox files must be shared as "Anyone with the link". Folder links are not supported; link each file.
- Files up to 500 MB and up to 500 pages per file (set lower defaults with "Max file size (MB)" and "Max pages per file").

### More tools for files and media from the same developer

- [PDF Text Extractor - Watch PDFs and Get Only What Changed](https://apify.com/neverempty/pdf-text-extractor-monitor) - watch PDF links and get only the text that changed
- [Image Compressor - Convert to WebP & AVIF, Resize, Strip GPS](https://apify.com/neverempty/image-compressor-webp-avif) - shrink and convert images before you share them
- [Video Frame Extractor - MP4, Google Drive & Dropbox to JPG/PNG](https://apify.com/neverempty/video-frame-extractor) - turn a video link into still images, then read the text in them here
- [Speech to Text from Links: MP3, MP4, Google Drive, Podcast RSS](https://apify.com/neverempty/speech-to-text-from-links) - turn the audio of MP3 and MP4 links into a transcript

### Thanks for using this Actor

We build these tools for people who run them every day, and we improve them from what users tell us.

- **Need another output or setting?** Tell us in the **Issues** tab. We add the most requested ones in the next version.
- **Found a bug or a wrong value?** Post the run ID in the **Issues** tab. Wrong data is the thing we fix first.

If this Actor saved you time, a short review helps other people find it.

# Actor input Schema

## `fileUrls` (type: `array`):

Public links to images (JPG, PNG, WebP, TIFF, BMP, GIF) or PDF files, including scanned PDFs: direct links, or Google Drive and Dropbox share links set to "Anyone with the link". One link per line. Empty = a public-domain scanned letter from the US National Archives as an example.

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

The languages printed in your files (up to 5). Picking the right language matters most for accents and non-Latin scripts. Default: English.

## `pdfMode` (type: `string`):

"Use embedded text when present" returns the exact text of digital PDFs instantly and reads scanned pages as images. "Read every page as an image" ignores embedded text (use it when a PDF has broken or garbled embedded text).

## `maxPagesPerFile` (type: `integer`):

A cap on the pages read (and charged) from each PDF or multi-page TIFF, counted from page 1.

## `pdfDpi` (type: `integer`):

How sharp each scanned PDF page is rendered before reading. 300 suits normal print; raise it for very small print, lower it for faster runs on large text.

## `includeWords` (type: `boolean`):

Adds a "words" list to each row: every word with its confidence and its box on the page (left, top, width, height in pixels). Useful for highlighting, redaction or form parsing.

## `maxFileSizeMb` (type: `integer`):

Files larger than this are skipped with a free row that says so.

## Actor input object example

```json
{
  "fileUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/6/68/Committee_For_Decent_Education_Press_Release_-_NARA_-_86752482.jpg"
  ],
  "languages": [
    "eng"
  ],
  "pdfMode": "auto",
  "maxPagesPerFile": 50,
  "pdfDpi": 300,
  "includeWords": false,
  "maxFileSizeMb": 100
}
```

# Actor output Schema

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

One row per image or PDF page with text: the text, page number, confidence, word, line and character counts, and where the text came from (read from the image, or the PDF's embedded text). Links that could not be read come back as their own free rows that say why.

# 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 = {
    "fileUrls": [
        "https://upload.wikimedia.org/wikipedia/commons/6/68/Committee_For_Decent_Education_Press_Release_-_NARA_-_86752482.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("neverempty/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 = { "fileUrls": ["https://upload.wikimedia.org/wikipedia/commons/6/68/Committee_For_Decent_Education_Press_Release_-_NARA_-_86752482.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("neverempty/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 '{
  "fileUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/6/68/Committee_For_Decent_Education_Press_Release_-_NARA_-_86752482.jpg"
  ]
}' |
apify call neverempty/image-to-text-ocr --silent --output-dataset

```

## MCP server setup

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