Tickd.ai
Model behaviour

How to Stop Claude Hallucinating on Uploaded PDFs

Updated 9/24/2026

When you upload a PDF to Claude, you expect accurate data extraction and analysis. However, Claude can sometimes "hallucinate"—inventing facts, mixing up numbers, or misinterpreting text layout. This behavior typically occurs due to poor document formatting, OCR conversion errors, or unstructured prompts that allow the model too much creative freedom.

You can significantly reduce or eliminate hallucinations when working with PDFs by applying structured document preparation and targeted prompting techniques.

Step 1: Verify and clean the PDF document layout Before troubleshooting Claude's output, confirm that the text inside your PDF is clean and readable by machine parsers. Claude reads the underlying text layer of the PDF, not the visual image (unless you are using visual analysis features).

  1. Check for selectable text: Open your PDF in a standard web browser or PDF viewer. Try to highlight and copy the text. If you cannot select the text, or if copying it pastes scrambled symbols or gibberish, the PDF lacks an accurate text layer.
  2. Run OCR on scanned files: If your document is a scan, run it through an Optical Character Recognition (OCR) tool (like Adobe Acrobat or an online converter) before uploading it to Claude. This converts raw images of text into actual selectable characters.
  3. Simplify complex tables: Multi-column layouts, nested tables, and complex charts often parse as scrambled, out-of-order text strings. If Claude is hallucinating data from a table, copy the table data directly, format it as a CSV or markdown table, and paste it into the chat instead of uploading the raw PDF.

Step 2: Implement XML tag containment Claude is trained to recognize and prioritize information structured within XML tags. Placing your document context inside XML tags helps the model isolate the document data from your instructional prompt.

1. Upload the file or paste the text: If you are pasting text directly, wrap it in tags like this: `xml <document> [Paste PDF contents here] </document> ` 2. Reference the tags in your instructions: In your prompt, tell Claude to only look inside those specific tags. For example: *"Using only the information contained within the <document> tags, answer the following question: [Your Question]. Do not use any external knowledge."*

Step 3: Use direct-quote constraint prompts The most effective way to stop Claude from hallucinating is to strip away its ability to guess. You can do this by forcing the model to cite exact phrasing from the document before answering.

1. Add a strict citation rule: Append this exact instruction to your prompt: *"For every claim or fact you state in your answer, you must provide a direct, verbatim quote from the document to back it up. If you cannot find an exact quote to support the answer, state 'Information not found in document' and do not attempt to answer."* 2. Review the output: If Claude provides quotes that do not actually exist in the PDF, it indicates a severe context length issue (see Step 4). If it correctly identifies that information is missing, the prompting strategy worked.

Step 4: Chunk large PDF documents If a PDF is too long (approaching hundreds of pages), the model's attention can drift, leading to missed details or hallucinations near the middle of the document.

  1. Split the PDF: Use a PDF splitter tool to break the document into smaller chapters or sections (ideally keeping uploads under 20-30 pages per run).
  2. Query sections sequentially: Upload Section 1, ask your questions, then clear the chat and upload Section 2. This keeps the active context clean and prevents the model from conflating different sections of the document.

When to escalate If Claude continues to invent data even when given a single-page, clean, selectable PDF with a strict direct-quote prompt, check the Anthropic status page to see if a model regression has been reported. If systems are normal, report the hallucination directly to Anthropic. You can do this by clicking the **Thumbs Down** icon on the incorrect response in the Claude Web UI to flag the bad output for their engineering team.

Quick fixes

  • Claude is down or not loading
  • Claude Pro billing or payment problem
  • Can't sign in to Claude

While you're here

Tickd is more than troubleshooting — these three are free and take seconds.

Agent BuilderDesign your own AI agent and export it to ChatGPT, Claude, Gemini or Grok.Build one free