Back to blog

Image to CSV: How to Extract Table Data Accurately

Learn how to convert an image to CSV step by step, fix scan problems, and check the output before your team relies on it.

Image to CSV: How to Extract Table Data Accurately

A phone photo of an invoice sits on one screen and a spreadsheet on the other. The cursor is blinking in cell B7 while you work out whether that digit is a 3 or an 8, and the finance close is on Thursday.

Every image to CSV converter will hand you a file within seconds. Knowing whether that file is right is the hard part.

A shifted column produces a CSV that opens cleanly, sums to the wrong total and looks normal in a preview. Nothing in the file warns you. Every value in the affected row sits one column over from where it belongs.

So treat the export as a claim to verify, not proof that extraction worked. Here is how the methods compare, where they break, and which checks catch a file that looks fine and isn't.

Image to CSV Methods and When Each Fits

Yes, an image can be converted to CSV automatically, but the file is only trustworthy when the tool rebuilds the table grid and each row is checked against the source.

Two jobs run inside any conversion. The first is character recognition: turning pixels into letters and digits. The second is grid reconstruction: deciding which token belongs in which row and column, including merged headers, borderless tables and tables that carry on to page two. Most complaints about image to CSV accuracy come from the second job, not the first.

The ambition behind it is old. Gustav Tauschek's 1929 "Reading Machine" compared illuminated character shapes against templates held in memory, as the documented timeline of optical character recognition records. A modern pipeline differs from that machine in grid reconstruction, not in character recognition.

Four routes get you from an image to a CSV file, and they fail in different places.

Method Best for Table accuracy Effort Main risk
Manual retyping A few one-off tables Depends on the typist High per page Typos and shifted rows
Free online image-to-CSV converter Clean single-table scans Good on clean scans, no check beyond that Low Shifted columns on merged or borderless tables
Desktop OCR tool with table export Repeated batches with the same layout Good when the layout matches the template Medium A template is needed for each layout
Document extraction API High volume and mixed document types Measured per field Low after setup Needs validation rules and a review queue

Decision rule: one table with no repeat ahead of you means a converter. Repeated batches of the same layout mean a desktop tool with a saved template. Mixed document types at volume mean an API with field-level validation and a review queue.

Retyping is accurate enough on four rows and dangerous at four hundred. The errors don't scatter evenly. They cluster on similar-looking digits, which is exactly the kind of mistake a second person scanning the page will also miss.

How to Convert an Image to CSV Step by Step

A five-step guide on how to convert an image to a CSV file format accurately.

The routine below is what I'd run on the first file of any new document type, before committing to a template or an API.

The seven-step routine

  1. Start with the highest-resolution original. A resized screenshot loses the hairlines that define cells and the small digits inside them. Pull the original PDF or camera file, not a forwarded, compressed copy.
  2. Confirm the tool has found the table region. Upload the PDF, JPG or PNG, then check the box it draws. If the box swallows the letterhead and the signature block, you'll get rows that belong to neither.
  3. Set the output before you extract. One CSV per table, comma delimiter, UTF-8 encoding. A document with two tables should produce two files rather than one merged file with a phantom row between them.
  4. Map the header row. Give every column one clear field name. Where the source has merged header cells, split them so each column carries a single name before extraction runs.
  5. Keep the raw text next to the normalized values. When a total looks wrong, the raw string tells you whether the tool misread the page or the normalization broke it. Without it, you're guessing.
  6. Compare ten rows and the last one. Check column alignment, negative signs, decimal separators and blank cells against the image. The final row catches a table whose bottom edge was cut off.
  7. Export clean. One header row, and double quotation marks around any field that contains a comma or a line break.

Before you extract: confirm the tool found the table, not the page. A box that takes in the invoice header and the bank details below will produce rows that belong to neither, and no validation rule will save you.

Why quoting decides whether the file imports

Step 7 isn't cosmetic. In October 2005 the Internet Engineering Task Force published RFC 4180, which registered the text/csv MIME type and fixed the structure most systems now expect: records split by line breaks, fields split by commas, and any field containing a comma, a quotation mark or a line break wrapped in double quotes, with inner quotation marks doubled.

Skip it and a product description with a comma in the middle splits into two columns, shifting every value to its right in that row. Skip it and one address with a line break turns a ten-row invoice into eleven broken records. The spreadsheet still opens. The columns don't.

Fix Image Problems That Break Your Columns

A wooden desk featuring a computer screen displaying CSV data, a printed order table, and office accessories.

A CSV can open cleanly and still put values in the wrong columns. The preview lines up. Three days later someone notices that every value below row 12 sits one column to the left, because a rotated scan pushed the right edge of one row into the next. Treat that export as a claim to verify, not proof that extraction worked.

Skew, low resolution, shadows and borderless tables damage the final CSV more than character-level OCR errors do. The pipeline that survives them runs in a fixed order: acquire the best image, detect the table region, correct rotation, normalize contrast and denoise, detect rows and columns, recognize cell text, map every token back to coordinates, and only then write the file. Most of the quality is won in preprocessing. A Python preprocessing walkthrough for document images shows the steps to run before you tune anything downstream.

Detection is its own hurdle. Reading a clean, already cropped table is much easier than finding that table on a full page first. Accuracy drops once the model has to locate the region as well as read it. Rotated and borderless layouts cause most of that gap. A box that includes the page header, or misses the last column, writes a file that still opens and still looks regular.

Image problems, their effect on CSV output and fixes

Image problem Effect on the CSV Fix
Skew or rotation Values drift into the wrong columns Straighten the image before upload
Low resolution (below about 150 dpi) Digits such as 3 and 8 are misread Rescan at 300 dpi, or pull the original digital file
Shadows or uneven background Blank or partial cells Crop tightly and normalize contrast
Borderless table Rows merge or split Define column positions manually
Merged header cells Header repeats or shifts Flatten the header into one name per column
Table continues across pages Rows lost at the page break Keep page order and check the first row of each page

A short walkthrough of the same preprocessing idea, from photographed page to structured rows:

If the source is a phone photo taken at an angle, rescanning beats repairing. Two minutes at the scanner is cheaper than an afternoon tracing which column moved and which totals need re-adding.

Checks That Show Whether Your CSV Is Correct

The file opens, every row loads, and the column headers look right. A quantity from the description row still sits under unit price, and the total stays plausible because both figures are numbers. A clean open is a claim to check, not proof the extraction worked.

A 99% character accuracy score can sit on top of a file where whole rows are wrong. Character recognition and record correctness are separate measurements, and only one of them tells you whether the file is safe to post.

Exact-match scores make the gap visible. In ICDAR scientific-table evaluations, the strongest reported systems reached 74% exact-match accuracy on one structure and content subtask and 55% on another, while a corrected cross-dataset benchmark lifted table recognition exact match to 81%, per the table recognition study published on arXiv. Complex tables with spanning cells and irregular layouts still fail regularly at the top of the benchmark.

A checklist infographic detailing five essential quality assurance steps for validating data extracted from images into CSV files.

The checklist every file gets

Checks to run on every CSV before it posts

Check Pass condition
Row count Matches the source table
Column count Identical on every row
Totals Subtotal plus tax equals total
Numeric signs Negative signs and decimal separators preserved
Blank cells Stay blank, never coerced to zero
Dates One format across the whole file
Duplicates Flagged for review
Sample A person compares random rows to the image

Two of those catch most of what the rest miss. Column count flags a delimiter problem the moment a quoted field splits and shifts every value one column to the right. The sample comparison catches what no schema can see, such as a line item landing on the row above because a long description wrapped.

Comparing decimals by eye is where the sample check usually falls apart, since a figure with a trailing zero added or a separator swapped can look identical at a glance. A step-by-step decimal comparison methods walkthrough takes the guesswork out of trailing zeros and separator styles.

Write the rules down, version them, and re-test when a supplier changes their invoice template. A written data validation and verification process is what separates a one-off script from a repeatable check.

Fail a check and the row goes to review with the source region attached. Pass every check and the document posts automatically. A document that fails one check does not become a partially posted record.

Document Types That Need Different Rules

Manual keying sets the baseline cost. Research cited by InvoScope puts the average human data-entry error rate for invoice processing at about 4%, roughly one erroneous invoice in every 25, and around $53 to correct a single error once tracing, system updates and re-approval are counted. At 100 invoices a month that's an estimated $1,600 to $1,900 monthly, or $19,000 to $23,000 a year, before late payments and lost productivity, per InvoScope's costing of manual invoice processing.

Cycle time compounds it. Accounts-payable benchmarks cited by Zycus put average processing at $12.88 per invoice and 9.2 days per invoice, with 68% of AP teams still keying invoice data into the ERP by hand, against best-in-class figures of $2.78 and 3.1 days, per Zycus's accounts-payable benchmark summary.

The same extraction method behaves differently across document types, because each carries different fields and a different consequence when a value is wrong. This is the table I'd hand a new analyst before they post anything.

Document types, risks and checks before posting

Document Fields to capture Main risk Check before posting
Invoice Supplier, invoice number, date, tax, total, line items Duplicate invoices and tax rounding Duplicate invoice number check, then total reconciliation against the line items
Payslip Gross pay, deductions, net pay Decimal separators and personal data handling Gross minus deductions equals net
KYC identity document Full name, document number, date of birth, expiry date Altered or fabricated documents Required fields complete and expiry after issue, plus a separate fraud check
Bill of lading Shipper, consignee, ports, container and weight Rows lost across pages Row count matches the packing list
Bank statement Date, description, amount, balance Negative signs lost Running balance reconciles line by line

Identity documents carry a risk a spreadsheet can't show. Veriff's Identity Fraud Report found that 4.18% of verification attempts in its 2025 data were fraudulent, about one in 25, and that altered, counterfeit or fabricated documents made up 13% of all fraud cases. Document fraud accounted for 20% of fraud recorded in North America, per Veriff's identity fraud report. Pulling a name, document number and expiry date into a CSV proves nothing about whether the document is genuine, so KYC extraction always needs an authenticity check beside it.

Transport paperwork has its own arithmetic. UNCTAD identified administrative costs in issuing, processing and transferring paper documents, plus extra costs when documents arrive late at the port of discharge, and estimated that moving away from transferable paper bills of lading could save stakeholders up to $6.5 billion in direct costs, per UNCTAD's report on paper transport documents.

The line that decides everything: a row that fails a check goes to review, and payments, ledger postings and compliance decisions never fire from an unchecked file.

Pick Your Next Step for Automated Extraction

Three actions take you from a folder of scans to a measured pipeline.

  1. Pick one document type. Choose the highest volume with the clearest validation rule, usually supplier invoices. A receipt with one total teaches you less than a document whose subtotals must reconcile.
  2. Collect about 100 real samples. Not the clean PDFs from a vendor's demo folder. The skewed phone photos, the faxed copies, the two-page statement missing its second page. Run them through the checks above and record row-level accuracy, not character accuracy.
  3. Write the review rule before you automate anything. Decide which failures route to a person and which actions wait for approval, then measure the share of documents that clear every check. That number is the only honest straight-through rate you'll get.

Where a converter or a desktop tool runs out of road is mixed documents at volume. Matil is not only OCR: it combines OCR, classification, validation and automation in one flow, reports precision above 99%, ships pretrained models that can be customized quickly, and accepts PDF, JPG and PNG files up to 50 MB. One endpoint offers three modes, a synchronous call that returns structured data instantly, an async job that reports back through a webhook, and batch submission for hundreds of documents in a single request, and you keep all rights over the documents you upload and the results you get back. If you're wiring this into an ERP or a claims system, the integration patterns in this guide to an API for data extraction are the place to start.

Adjacent industries have already made this move. Construction quantity takeoff went from manual measurement to Exayard AI-powered takeoff and estimating, and the migration path looks the same: validate a sample, keep a person on the exceptions, then widen the automation as the numbers hold.

The question worth answering today isn't which tool to buy. It's how many documents a month pass through manual rekeying in your team, and how many of those would fail one of the checks above. The second number is the size of the project.


Matil turns photographed invoices, delivery notes, bank statements and identity documents into validated CSV and JSON through a single endpoint, with classification, field-level validation and a clear path for the rows that need a person. If you're weighing up automating your document intake, upload a batch of your own scans and measure them against the checks above before you decide anything. You can see how it works, and start with your own documents, at Matil.

Related articles

© 2026 Matil