Reading documents with Claude

Claude OCR: Read PDFs and Extract Data With Claude

Claude OCR means using Claude to read a document instead of a dedicated OCR engine. Claude accepts PDFs up to 32 MB and 100 pages and reads each page with vision, so it handles scans too and can return named fields from a prompt. Here is the code, the real limits, and where a purpose-built OCR API pulls ahead.

The gap a raw Claude call leaves: no per-value confidence score, a hard 100-page ceiling, and token cost that climbs with length. DocuOCR fills all three. Try the extractor below. Last updated July 2026.

  • Reads scanned PDFs with vision
  • Extracts named fields
  • Confidence score per value
  • Handles 100+ page documents
Try it now, no signup

PDF, JPG, PNG, BMP, HEIC, TIFF

Upload a document to extract

Extract fields with confidence scores, no 100-page limit, right in the browser.

SOC 2 Type II
256-bit encryption
US data handling
Confidence scored
32 MB
max PDF size
100 pages
hard per-document limit
1,500 to 3,000
tokens per page
Yes
reads scans via vision
// The short answer

Can you use Claude for OCR?

Yes, you can use Claude for OCR. Claude reads PDFs and images through its vision capability, so it recognizes the text on a page and can also extract named fields, answer questions, and follow a prompt, which a plain OCR engine cannot do. It is not a separate OCR step running in the background: Claude treats each page as both an image and a text layer and reasons over both, so a scanned PDF with no embedded text works the same as a digital one. The practical limits are real, though. A PDF can be up to 32 MB and 100 pages, and that 100-page ceiling is a hard model limit, not something a bigger plan raises. Cost is by tokens, roughly 1,500 to 3,000 per page, so a long document runs well above a dedicated OCR engine. And Claude does not return a reliable per-value confidence score, so for anything touching money you still need to score confidence and review the values it was unsure of.

Good fit, poor fit

  • Good: prototypes, reasoning over a document, mixed or handwritten layouts.
  • Poor: high volume, documents past 100 pages, anything needing a confidence gate.
// Copy and run

Read a PDF with Claude

Send a PDF as a base64 document block and ask Claude to return the fields you want as JSON. This is Python with the anthropic SDK.

claude_ocr.py
import anthropic, base64

client = anthropic.Anthropic()  # reads ANTHROPIC_API_KEY

with open("invoice.pdf", "rb") as f:
    pdf = base64.standard_b64encode(f.read()).decode()

msg = client.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": [
        {"type": "document",
         "source": {"type": "base64",
                    "media_type": "application/pdf",
                    "data": pdf}},
        {"type": "text",
         "text": "Extract the invoice number, date and total as JSON."},
    ]}],
)
print(msg.content[0].text)

That works for one document under 100 pages. For production you add the parts Claude does not give you: split anything over 100 pages, retry on rate limits, batch across many files, and, most important, validate every value because the reply carries no confidence score. The document OCR API returns those fields with a confidence score already attached, and the PDF to JSON API guide shows the same job as three plain HTTP calls.

// The real limits

Claude OCR limits and behavior

What Claude accepts, how it reads, and where the ceilings sit. From the Claude platform docs, verified July 2026.

Property Claude
Max PDF size 32 MB per document
Max PDF pages 100 pages (model-level hard limit)
How it reads Vision: each page as image and text layer
Reads scans Yes, no text layer needed
Tokens per page About 1,500 to 3,000, by density
Confidence score per value No reliable native score
Image formats PNG, JPEG, GIF, WebP
Office files (DOCX, XLSX) Not native, convert to PDF first

The two limits that bite in production are the 100-page cap and the missing confidence score. A 300-page loan file has to be split and stitched back together, and without a per-value score you cannot tell a value Claude read cleanly from one it guessed. For a broader view of how Claude stacks up against GPT-4o, Gemini and Mistral, see LLM OCR vs traditional OCR.

// Raw Claude vs an extraction API

When a purpose-built OCR API is the better call

You need a confidence gate

Auto-accept high-confidence fields and review the rest. A raw Claude call cannot tell you which values it was unsure of.

Documents run past 100 pages

No page cap to work around, no splitting and stitching a long file back together by hand.

You process at volume

Batch thousands of documents on a per-page rate instead of paying token cost that climbs with every field.

You want tables as rows

Structured table rows with cells in order, not a prose description you have to re-parse.

You need an audit trail

A stored result with confidence and positions, so a reviewer can see why a value was accepted or flagged.

You want plain REST

Three HTTP calls that return JSON, no prompt engineering to keep the output shape stable.

// Frequently asked

Claude OCR FAQ

Can Claude do OCR?
Yes. Claude reads PDFs and images through its vision capability, so it recognizes and returns the text on a page, including scanned pages with no text layer. It is not a dedicated OCR engine running in the background: Claude treats each page as both an image and a text layer and reasons over both. That means it can also extract named fields, answer questions about the document, and follow a prompt, which a plain OCR engine cannot. The tradeoff is cost and the lack of a per-value confidence score.
Can Claude read a scanned PDF?
Yes. Because PDF support runs on Claude vision, a scanned PDF with no embedded text still works: Claude reads the page image directly. Accuracy is high on clear scans and drops on small fonts, faint print, or low-resolution images, and per-page token use is higher for a scan than for a clean digital PDF. There is no separate OCR step to enable; you send the PDF and Claude reads whatever is on the page.
What are Claude PDF limits?
On the Claude API a PDF can be up to 32 MB and 100 pages per request. The 100-page ceiling is a model-level hard limit, not something a higher plan lifts, so longer documents must be split into chunks before you send them. Each page typically consumes 1,500 to 3,000 tokens depending on how dense it is, billed at standard API rates with no extra PDF fee.
How much does Claude OCR cost?
Claude bills by tokens, not by the page, so cost depends on document length and how much you ask it to return. At roughly 1,500 to 3,000 tokens per page plus your output, a dense multi-page document can cost several cents per page, well above the roughly $1.50 per 1,000 pages of a dedicated OCR engine. The upside is that the same call also structures the data; the downside is that the bill scales with every field you ask for.
Does Claude hallucinate when reading documents?
It can, like any large language model. Claude is generally careful about not inventing content, which is why teams pick it for compliance-sensitive work, but careful is not the same as a confidence flag. When a value is genuinely hard to read, a model can still return a plausible wrong answer, and Claude does not attach a reliable per-value confidence score you can gate on. For anything touching money or a system of record, score confidence and review low-confidence values.
Is Claude or a dedicated OCR API better for data extraction?
For a prototype, a low volume, or documents that need reasoning, calling Claude directly is a fine choice. For production, a purpose-built extraction API is usually better because it returns named fields and tables already structured, handles documents past the 100-page limit, batches at volume, and scores confidence on every value so you can auto-accept the clean data and review the rest. DocuOCR returns that confidence score, which a raw Claude call does not.
What formats can Claude read?
Claude accepts PDFs and common image formats (PNG, JPEG, GIF, WebP) as document or image input on the API. For a PDF it reads each page as image plus text; for a standalone image it reads the picture directly. It does not natively ingest Office files like DOCX or XLSX as documents, so convert those to PDF first if you need Claude to read them.
Which Claude model is best for OCR?
Any current Claude model reads documents, so the choice is about cost versus depth. A smaller, faster model like Claude Haiku is economical for straightforward reads at volume, while a larger model like Claude Opus is stronger on complex layouts and reasoning over the content. For a real workflow the model matters less than the pipeline around it: confidence scoring and human review on low-confidence values are what keep the output trustworthy.

Everything Claude reads, plus a confidence score

DocuOCR reads native and scanned documents past the 100-page limit, returns named fields and tables as JSON, and scores confidence on every value so a wrong read is flagged before you trust it. Generate an API key and test it on your own documents, free, before you pay per page.