aifree.dev

Why does it mangle the tables in my PDF?

Mangled PDF tables: a PDF stores a table as pieces of text placed at spots on the page, plus lines, with nothing that says which row or column a piece belongs to; pulled out as text, the pieces come in the order the file wrote them, empty cells leave no trace, merged cells and tables that continue on the next page shift the rest, and the chatbot has to guess the grid back; send a screenshot of the table to a model that reads images, paste a CSV or Excel export, and check a few cells of the table it returns · Beginner · 5 min · format, rag · after Chunking: chunk size, overlap and boundaries in RAG

A chatbot mangles PDF tables because a PDF stores pieces of text at spots on the page, not rows and columns. Pulled out as text, the grid is gone and the model guesses it back. Screenshots and CSVs keep it.

Before you start: could you explain this to a friend?

1 = not at all · 5 = easily

  1. 1 Guess first

    A PDF shows a neat table with rows and columns. Inside the file, how is that table stored?
  2. 2 Look

    A table in a PDF, and what a chatbot gets from it

    1 / 6

    The page

    RegionQ1Q2
    North120135
    Southempty110
    West8794

    a test PDF we made (illustrative table); positions as written in the file

    A small table in a PDF, as you see it. South has no Q1 number: that cell is empty.

    The file holds only text at spots. Pulled out as text, the empty cell leaves no trace, and 110 slides into the wrong column.

  3. Many chat apps pull the text out of a PDF before the model sees it. The model then reads tokens, small chunks of text, with the grid gone. An empty cell leaves no trace, a merged cell appears once for several rows, and a table split over two pages gets a page number in its middle.

  4. 4 You are the model

    You are the chatbot, asked to rebuild the table, and you get only what the app gives you. Three times, say what South scored in Q1.

    Round 1 of 3. Text from the column-order file

    Region North South West Q1 120 87 Q2 135 110 94

    Rebuild the table: what did South score in Q1?

    texts: pypdf output from our test PDFs; picture: the same table

    You are the chatbot. Say what South scored in Q1.
  5. 5 Check

    In the picture, why did 110 end up under Q1 in the rebuilt table?
  6. Tables stay hard even when a model reads the page as an image. On OmniDocBench (2025), 981 real pages, a score of 100 means a perfect rebuilt table: the best tool reached 78.6 on English tables, GPT-4o 72.0. Merged cells pulled GPT-4o from 64.7 to 56.8.

  7. Three habits help. Send a screenshot, a picture of just the table, to a model that reads images, so it sees the grid. If you have the source file, export the table to CSV or Excel and paste that. Ask for the table back first, and check three or four cells against the PDF before you trust a total.

  8. 8 Say it back

  9. 9 Mission · 5 min

    Open a PDF with a table (a bank statement, a timetable, a report), select the table and copy its text. In Google AI Studio (free), pick Gemini 3.8 Flash, paste it and ask “Rebuild this as a table.” Check three cells against the PDF. Then, in a new chat, upload a screenshot of just the table with the same request. Which version got all three cells right?

Three quick ones

Drawn at random from this lesson's pool; different next time.

Done?

Now: could you explain this to a friend?

1 = not at all · 5 = easily

Answer the three quick ones first.

Get an email when new lessons come out

New lessons arrive in the weekly digest, only in a week that has one. You confirm by email first; unsubscribe in one click.

Sources

  • Test PDF made for this lesson on 2026-10-24 (illustrative table, one page, Helvetica, 4 rows x 3 columns, South’s Q1 cell empty), written twice: column by column and row by row. Content stream: “Region” at x 72 y 700, “Q1” x 200 y 700, “Q2” x 280 y 700; North 120 135, South (empty) 110, West 87 94 at y 680, 660, 640; plus grid lines. Text extracted with pypdf 6.21.2 extract_text() on 2026-10-24: column-by-column file “Region\nNorth\nSouth\nWest\nQ1\n120\n87\nQ2\n135\n110\n94”; row-by-row file “Region Q1 Q2\nNorth 120 135\nSouth 110\nWest 87 94” (pdfminer.six 20260107 gave one piece per line for both)
  • The rebuilt table with 110 under Q1 and the role’s screenshot are illustrative, not recorded model output
  • Ouyang et al., “OmniDocBench: Benchmarking Diverse PDF Document Parsing with Comprehensive Annotations” (CVPR 2025; arXiv:2412.07626 v2, 2025-03-25, https://arxiv.org/abs/2412.07626, checked 2026-10-24): 981 pages, 428 table boxes; tables scored with TEDS (tree-edit-distance similarity, shown 0 to 100). Table 2, end-to-end Table TEDS, EN: MinerU 78.6, Mathpix 77.0, Qwen2-VL-72B 76.8, GPT4o 72.0, Marker 67.6. Table S1, end-to-end Table TEDS by table attribute, GPT4o: Merge Cell (+/-) 56.8/64.7, Rotate (+/-) 14.2/62.7; Qwen2-VL-72B Merge Cell 67.9/78.1
  • aifree.dev catalog, google-gemini-developer-api-free-tier (verified 2026-10-12, live check 2026-10-24): Gemini API free tier and Google AI Studio, Flash models with image and file input

Published Oct 24, 2026 · updated Oct 24, 2026

Embed this

Paste this into a blog post or course page: the lesson's main picture in an iframe, with a link back to the full lesson.

<iframe src="https://aifree.dev/embed/explain/pdf-tables" width="100%" height="620" style="border:0;max-width:720px" title="Why does it mangle the tables in my PDF? (aifree.dev Explain)" loading="lazy"></iframe>
<p><a href="https://aifree.dev/explain/pdf-tables">Why does it mangle the tables in my PDF? Interactive lesson on aifree.dev</a></p>

Never miss new offers and news

New tools, credits, and AI news are added regularly. Pick how you want to hear about them.

Telegram channel
Join @aifree_dev and get new free AI offers and news right in your Telegram feed.
Browser notifications
Turn on push notifications and get an alert on this device whenever something new is posted. No account needed.
Email newsletter
A weekly digest of new, changed and expiring free AI offers. Double opt-in, one-click unsubscribe. See the latest issue.

Unsubscribe anytime. Privacy

Frequently asked questions

What is aifree.dev?

aifree.dev helps everyone access AI through a curated directory of free AI tools, API credits, free tiers, and startup programs for coding, image, voice, video, and students - verified regularly.

How are offers presented?

Each offer includes its access details, free models when available, and expiration information when provided. Limited-time deals stay visible so they are easy to compare.

Do education and startup programs need verification?

Yes. Providers usually ask students to verify their status with a school email, student ID, or a program like the GitHub Student Pack, and ask startups to verify company details such as age, funding, or website. Check each offer’s claim page for the exact requirements.

What kinds of free AI offers are listed?

Free tiers and free trials from AI providers, free API credits, startup and student programs, and free tools for coding, image generation, voice, and video.

How can I suggest a tool or report a broken link?

Use the submit form: paste the offer page URL and a short note. A person checks every submission before anything is listed. Broken links and changed terms go through the same form.

+

Know a good one?

Tell us about an AI tool worth knowing. Found a broken link? We want to hear that too.

Submit an offer