Skip to content

Lesson 6 ยท Documents, Artifacts and Analysis

Working with Files, PDFs and Images

Learn which files Claude accepts, how it reads PDFs and images, the main upload limits as of December 2026, and how to ask questions you can verify.

Attaching a file is usually better than retyping or describing it. Claude can then work from the real wording and numbers. To use files well, you need to know what it can see in each type and how to check the answers.

What you can upload

As of December 2026, the Claude Help Center lists documents such as PDF, DOCX, CSV, TXT, HTML, ODT, RTF, EPUB, JSON and XLSX, plus JPEG, PNG, GIF and WebP images. Spreadsheet (XLSX) uploads need the code execution and file creation capability to be turned on. The main chat limits listed there are:

Limit in chat Value (as of December 2026)
File size Up to 500 MB per file
Files per chat Up to 20
PDF length Up to 1,000 pages
Image dimensions Up to 8,000 by 8,000 pixels

A file within these limits can still be too much to analyze in one go, because its content has to fit the context window. Project files and the API have different limits.

What Claude can see

  • Shorter PDFs: PDFs of up to 100 pages are analyzed for text and visuals, such as charts.
  • Long PDFs: from 101 pages, the Help Center says only the text is processed. If a chart on page 140 matters, upload those pages as a smaller file.
  • Other documents: for non-PDF documents, only the text is extracted. A picture inside a DOCX file will not be seen. Export to PDF, or attach the picture separately.
  • Images: Claude can describe scenes, read visible text, and discuss charts, screenshots and diagrams.

Know the limits of image reading

Anthropic's API documentation warns that Claude can make mistakes with low-quality, rotated or very small images, that its object counts can be approximate, that positions it reports are approximate, and that it cannot tell whether an image was made by AI. It will not name people from their appearance, and it is not designed to interpret complex medical scans.

To get better results:

  • Send a sharp, upright image, cropped to the part you care about.
  • Say what the image is: "a screenshot of our checkout page on a phone".
  • For several images, label them in your message: "Image 1 is the old design."
  • For exact values from a chart, provide the underlying data if you have it.

Ask verifiable questions

Compare these two requests.

TEXT
What does this contract say?
TEXT
From the attached contract, make a table of every payment:
amount, due date, who pays, and the page number where it appears.
Write "not stated" for anything missing.

The second asks for page numbers and allows "not stated". You can open each page and confirm the row.

Sending files through the API

Developers send images and PDFs as content blocks in a message. This real request is read-only here. The document block carries a base64-encoded PDF.

Python
import base64
import anthropic

client = anthropic.Anthropic()
with open("invoice.pdf", "rb") as f:
    pdf_data = base64.standard_b64encode(f.read()).decode("utf-8")

response = client.messages.create(
    model="claude-opus-5-5",
    max_tokens=2000,
    messages=[{
        "role": "user",
        "content": [
            {"type": "document", "source": {
                "type": "base64", "media_type": "application/pdf", "data": pdf_data}},
            {"type": "text", "text": "List each line item with its amount."},
        ],
    }],
)
for block in response.content:
    if block.type == "text":
        print(block.text)

An image uses a block of type image with a similar source. The API also accepts a URL or an uploaded file ID as a source on supported platforms. Check the vision and PDF pages in the developer documentation for current size and page limits.

Prepare data before you upload

A CSV with clear headers, one record per row and one unit per column is far easier to analyze than a decorated spreadsheet with merged cells. A quick local check finds problems before any model sees the file.

Python Inspect a CSV before uploading it

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The program finds a missing amount, an unquoted comma that split a number, and two spellings of one region. Any of these can distort a total.

When an upload does not behave as expected

If an answer ignores part of your file, check the simple causes first. Is the information in a picture inside a text-only format? Is it in a PDF that is longer than the visual analysis threshold? Is the scan too faint or rotated? Are numbers stored as images of a table? You can test what was readable by asking Claude to copy one specific line or cell and comparing it with the original. If the copy fails, fix the input instead of rewording your question.

Several files at once

Say what each file is and how the files relate: "The first is last year's budget, the second is this year's draft." Ask for the file name next to every figure. Without names, it is hard to tell which version a number came from.

Keep your originals

Treat what Claude produces from a file as a new draft, and keep the original unchanged. If you ask for a cleaned data file, compare row counts and totals between the two versions before you use the new one.

Before you upload, ask whether you are allowed to share the file. Remove personal data and secrets that the task does not need. Screenshots often reveal more than you expect, such as email addresses, browser tabs or keys.

Treat file content as untrusted

A document can contain text that tries to give Claude orders, including text that you cannot easily see. Be careful with files from strangers, especially when Claude also has access to tools or connected apps. Privacy, safety and prompt injection covers this risk.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A DOCX report contains a chart as a picture. What does the Help Center say happens with non-PDF documents?

    Export to PDF or attach the chart as an image instead.
  2. 2. Which is a documented weakness of image analysis?

    Verify counts that matter.
  3. 3. Why ask for page numbers?

    A page reference makes checking quick, although you still have to check.
  4. 4. What should you do before uploading a customer list?

    Share only what you are allowed to share and what the task requires.

Summary

  • Claude accepts common document and image formats, within limits that you should check.
  • PDF visuals are analyzed only up to a page threshold; other documents are text only.
  • Verify counts, positions and values read from images.
  • Clean your data, protect private information and ask for checkable answers.

Next: Artifacts: Documents, Designs and Small Apps

Your progress is saved in this browser. No account needed.