How Do You Get Gemini to Read Charts in a PDF?
Upload the PDF itself, not a text copy, and ask for each value along with its page number, stating whether it's printed or estimated from the chart. Google's API docs say the model reads PDFs with native vision, so it can read charts, diagrams and tables as well as the text.
From the attached PDF, extract the data in [the chart on page X / every chart about Y]. Return a table with these columns: page, chart title, series, category or date, value, unit, and "printed" or "estimated". Mark a value "printed" only if the number appears on the page. Mark it "estimated" if you read it from the height of a bar or a line. Don't calculate anything new. If a label is unreadable, write [unreadable]. Then offer this as a spreadsheet.
- Reads text and images
- Reads charts and diagrams
- Reads tables
- Read as text only
- Charts are lost
- Formatting is lost
- 50 MBPDF size at most
- 1,000Pages at most
- 258Tokens per page
- 48 hoursFiles API storage
Try it now
- 1Click Add files, then Upload Files, and attach a PDF with at least one chart.
- 2Paste the prompt above with the page number filled in, and click Submit.
- 3Compare three "printed" values with the page, and sanity-check one "estimated" value against the chart axis.
- 4You'll know it worked when the printed values match exactly, and the estimates are clearly labeled as estimates.
Use it when
Pulling figures from annual reports, research papers, slide decks saved as PDF or scanned tables. It's also useful when you'd like a chart's numbers in a spreadsheet to work with.
Skip it when
When the original data is available. A CSV is more accurate than values read off a bar chart. Also, for a number going into a filing or a contract, treat the output as a pointer to the right page, and read the page yourself.
Why it works
Google's document docs say the model processes the whole document, including text, images, diagrams, charts and tables, and can extract structured output or transcribe content while keeping the layout. Plain-text formats like TXT, Markdown and HTML are read as text only, so charts and formatting are lost. On the API, PDFs can be up to 50 MB or 1,000 pages, and large pages are scaled down to a maximum of 3072 x 3072 pixels. Small type in a large chart can suffer from that. In the app, most non-video files can be up to 100 MB.
Example
Say an annual report has a revenue chart on page 34, with five bars and labels on only the first and last. Ask for the table above. The two labeled bars should come back as "printed" and the other three as "estimated". That label is what stops a rough reading from turning into a precise-looking number in your spreadsheet. If you need the exact figures, look in the financial tables later in the report.
Going further
On the API, Google says each PDF page counts as 258 tokens, and Gemini 3 doesn't charge for native text embedded in a PDF, with page images counted under the IMAGE modality. Files uploaded through the Files API are stored for 48 hours, free of charge. Page size doesn't change the cost, since lower sizes save bandwidth but not money. For repeatable extraction, use structured output with a JSON schema. Google notes that minLength and uniqueItems, among others, aren't enforced, so validate those in your own code.
Common mistakes
- Copying the PDF's text into the chat. The charts don't come with it.
- Uploading a scan that's sideways or blurry. Google's docs say to fix the orientation and avoid blurry pages.
- Letting estimates and printed numbers sit in one column without a label. Later, nobody can tell them apart.
- Asking Gemini to total values as it extracts them. Keep extraction and calculation apart, and use Sheets or code for the math.
Sources
- Document understanding, Gemini API docs
- Upload and analyze files, Gemini Apps Help
- Use Gemini Apps, Gemini Apps Help
Checked 6 November 2026. Products change often, so confirm details with the vendor.