# Optical character recognition (OCR)

> Canonical: https://skillalmanac.com/glossary/optical-character-recognition | Last verified: 2026-11-24 | Index status: index-eligible

Optical character recognition (OCR) is technology that converts images of text, such as scans, photos and image-only PDFs, into machine-readable text that can be searched, copied and edited.

Also called: OCR, OCR AI, what is OCR, OCR software.

## In plain language

An image-only scan contains pictures of letters rather than extractable characters. OCR recognizes those pictures and produces machine-readable text. A scanned PDF may already contain a hidden OCR text layer, so check before running recognition again. Output can contain wrong digits or words, and extracted tables may lose structure. Compare important values with the page image; readable-looking output is not proof of a faithful transcription.

## Technical definition

OCR converts text images into machine-readable characters. Systems may preprocess an image, recognize text and return positions or structure; implementation steps vary. Google's Vision API distinguishes general TEXT_DETECTION from document-oriented DOCUMENT_TEXT_DETECTION, which returns page, block, paragraph, word and break information. Recognition and extracting an existing PDF text layer are different operations. Neither a searchable text layer nor layout annotations guarantee an editable reconstruction of the original document.

## How it shows up when you use agents

Many PDFs and images contain no text a program can read, only pictures of pages. When you hand one to Claude Code or another agent, the agent has to run OCR first or use a model that reads images, and what it gets back depends on the scan. The [anthropic/pdf](/skills/anthropic/pdf) skill covers reading and OCRing PDFs, and [pdf-extraction-and-forms](/skills/skill-almanac/pdf-extraction-and-forms) adds a triage script that routes each file and read-back checks on the result.

The usual failure is silent. OCR returns text that looks plausible but has a swapped digit, a split word or a merged column, and the [language model](/glossary/large-language-model) reasons from it as if it were right. A table can come back as a stream of numbers with its structure lost. This is also related to [computer vision](/glossary/computer-vision), since the input is an image.

What breaks when this is misunderstood: people ask an agent to summarise a scanned contract and trust figures that were misread upstream. The safer habit is to check which kind of PDF you have before extraction, spot-check numbers and names against the page image, and keep a log of repairs. [ocr-text-repair](/skills/skill-almanac/ocr-text-repair) fixes a misread only when the document itself proves the correct word and records each change. Next time, extract, then verify the five most important figures by eye before the agent builds on them.

## Worked example (illustrative)

In a synthetic receipt example, OCR outputs `1O0.00`. Do not automatically replace every letter O with zero: an item code may legitimately contain O. Compare the amount against the image, record a supported correction to `100.00`, and retain unresolved cases. This is an illustrative transcription error, not an OCR engine run or accuracy benchmark.

## Common confusions

- **OCR versus a PDF text layer.** A PDF can contain native text, image-only scans, or scans with an existing OCR layer. Inspect the page before deciding whether to extract text, recognize it, or redo poor recognition.
- **OCR versus computer vision.** OCR is one specific task, reading text from an image. [Computer vision](/glossary/computer-vision) is the broader field of getting information from images.
- **OCR versus handwriting recognition.** Printed text is the classic case. Google Cloud's Vision page lists handwriting extraction among the uses of its OCR features.
- **Myth.** OCR output is always a faithful copy. Recognition and PDF extraction can both introduce errors. Measure a named system on representative documents rather than promise universal accuracy.

## Worked examples in this catalogue

### [pdf](https://skillalmanac.com/skills/anthropic/pdf)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: A PDF read, merged, split, filled, created and OCRed, as the skill's own description puts it.

Why it exercises the concept: It is the direct way to give a coding agent scanned PDFs, where OCR can make image-only page text available for extraction. An existing usable text layer may instead be extracted directly.

### [pdf-extraction-and-forms](https://skillalmanac.com/skills/skill-almanac/pdf-extraction-and-forms)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Text, tables and form fields taken in and out of PDFs with a triage script, a route table and read-back checks.

Why it exercises the concept: A triage script, a route table and read-back checks help handle PDFs that need OCR and catch bad extraction.

### [ocr-text-repair](https://skillalmanac.com/skills/skill-almanac/ocr-text-repair)

Status: illustrative example from the item's own documentation, not executed for this page.

What you see: Broken OCR text repaired with a change log, fixing a misread only when the document itself proves the correct word.

Why it exercises the concept: OCR output contains misreads. This skill shows the repair step and keeps a log, so each correction can be reviewed.

## Related terms

- [Computer vision](https://skillalmanac.com/glossary/computer-vision.md)
- [Natural language processing (NLP)](https://skillalmanac.com/glossary/natural-language-processing.md)
- [Multimodal AI](https://skillalmanac.com/glossary/multimodal-ai.md)
- [Machine learning (ML)](https://skillalmanac.com/glossary/machine-learning.md)
- [Training data](https://skillalmanac.com/glossary/training-data.md)
- [AI agent](https://skillalmanac.com/glossary/ai-agent.md)

## Sources

- [What is optical character recognition (OCR)?](https://www.ibm.com/think/topics/optical-character-recognition), IBM (accessed 2026-11-24)
- [Detect and extract text from images](https://docs.cloud.google.com/vision/docs/ocr), Google Cloud (accessed 2026-11-24)
- [Extract Text from a PDF (OCR vs. Text Extraction)](https://pypdf.readthedocs.io/en/stable/user/extract-text.html), pypdf documentation (accessed 2026-11-24)

Definitions are written by Skill Almanac from the sources above and checked against them on 2026-11-24. [Glossary index](https://skillalmanac.com/glossary.md).
