PDF to Excel Converter
Operator: Abdulla Al Fahad. How tools are built and checked
A table in a PDF is not stored as a table: each word sits at a coordinate, ruling is drawn as separate lines, and nothing records where a row ends or which column a figure belongs to. PDF to Excel rebuilds that structure from the text alone, turning words on one baseline into a row and white channels that run down through many rows into column boundaries. Amounts become real numbers formatted as printed: $12,450.00 is stored as 12450 and shown as currency, 4.5% as 0.045 shown as a percentage, (1,300.50) as −1300.5 in brackets. Leading-zero codes, dates, phone numbers and version strings stay text.
You get an Excel workbook with one sheet per page or all pages on one sheet, or one CSV holding every page, saved as UTF-8 with a byte-order mark so Excel shows accented names and currency signs correctly. Conversion starts when a PDF is chosen and repeats whenever an option changes, with the text positions read by the PDF renderer in the browser and the spreadsheet written there; the preview shows each sheet's first 50 rows, and the chips give the row count and, for a workbook, the sheet count. Only text stored in the file can be read, so a scan, being a picture of each page, yields nothing.
Key features
- Columns found from white channels across many rows, sparse columns such as a single credit kept, wrapped descriptions left in their column as extra rows.
- Amounts, percentages and bracketed negatives typed as numbers with their printed formats; leading-zero IDs, dates, phone numbers and version strings kept as text.
- Number style detected or fixed at 1,234.56 or 1.234,56, or Keep numbers as text for the printed strings exactly.
- XLSX with sheets named Page 1, Page 2 and so on, or every page on one sheet named after the file, columns sized to their content; or one RFC 4180 CSV.
- Rotated pages read as displayed, fake italics and fake bold read correctly, footnote marks kept out of figures.
- A Rows to keep switch that drops titles and captions while keeping wrapped cells.
How text on a page becomes cells
Text comes from pdf.js, which reports each run of characters with its position, size and font. Runs are placed in the frame a viewer shows, so a page with /Rotate is read as it appears on screen, and a rotated page with no upright text is read as stored rather than called empty. Vertical labels, upside-down and mirrored text are skipped, while the slanted glyphs Word, LibreOffice and Chrome draw for fake italics are kept. A word overprinted within a point of itself for fake bold counts once, and in a monospaced font such as Courier a word space a full character wide does not split a cell.
A new row starts where baselines differ by more than half the smaller font size, and runs less than 0.45 of the font size apart form one cell. Small type, up to 80% of the line's size, that touches a word on the line and sits between 0.3 of the size below and 0.8 above its baseline joins that line, set off by a space, so an amount with a footnote mark reads 12.50 1, never 12.501. Lines are grouped at vertical gaps over 2.5 times the median line spacing, and each group's columns come from a 1-point map of how its multi-cell lines cover the width: a white channel at least 3 points wide is a boundary. A tenth of the lines, rounded down, may cross a channel without closing it, so one long description cannot fuse two columns, and a column only a few rows use, such as a Credit column with one entry, keeps boundaries of its own.
Detect the number style counts the cells that read as numbers in only one style: 1.234,56 and 3,5 vote comma, 1,234.56 and 7.25 vote dot, and cells like 1,234 that fit both only settle a tie; with no unambiguous cell, the 1,234.56 style wins. A number may carry a minus sign, an en dash or U+2212, accounting brackets, a trailing percent, or one of $ € £ ¥ ₹ ৳ ₩ ₽ ₺ ₦ ₱ on either side, and the dot style accepts Indian grouping such as 12,34,567. A figure of more than 15 digits stays text, as Excel keeps only 15 significant digits, and a plain whole number of 12 digits or more gets the format 0, so Excel shows it in full instead of 1.23457E+11. Formats are stored as Excel's neutral codes: one cell reads 1.234,56 in a German Excel and 1,234.56 in an American one.
How it works
pdf.js opens the file with an empty password once its size and %PDF header have been checked. A PDF that merely forbids printing or copying needs nothing more, while one locked with a password goes no further than the sentence pointing to Unlock PDF. Each selected page is read with getTextContent, whitespace-only runs and marked-content items are dropped, and a page that yields nothing is noted for the warning. Runs become lines, cells and groups, and each group's columns are computed once from its multi-cell lines, along with a strict map of gaps of 3 points or more that no multi-cell line enters.
That strict map sorts the one-cell lines: one reaching across such a gap, or standing before the group's first multi-cell line outside any single later column, is a title or caption in column A, and any other is a wrapped cell placed in the column it sits in. The number style is then settled over all cells at once and each cell parsed into a value and a format. ExcelJS writes typed cells with column widths of 8 to 60 characters; the CSV is padded to its widest row, as Excel pads its own, and writes numbers with their printed decimals, no grouping and a full stop as the decimal mark, so $12,450.00 becomes 12450.00 and 4.5% becomes 0.045.
Common use cases
- An accounts assistant moves a supplier invoice's line items into a reconciliation workbook, with quantities, prices and VAT rates arriving as numbers SUM can add.
- An analyst lifts five years of figures from an annual report, where losses are in brackets and empty years a dash, and charts them without retyping.
- A buyer converts a German price list printed as 1.234,56 and a British one printed as 1,234.56, each with the matching Numbers setting, so both arrive as ordinary numbers.
- A small business checks a supplier's statement of account, invoices with one payment in the Credit column, against its ledger; the lone payment keeps its own column.
- A league secretary turns a federation's fixture list into a sheet that can be filtered by team and venue.
How to use this tool
- Choose the PDF. Conversion begins immediately with Excel workbook (.xlsx), One sheet per page, Keep all text, titles and notes too and Detect the number style, and the first sheet appears in the preview.
- Compare the preview with the PDF: the header row, a few amounts and any wrapped description, and set Numbers by hand if the document's style is ambiguous.
- Pick Only rows with two or more columns if text surrounds the table, a Pages range if only some pages hold tables, and CSV (all pages in one file) if the data is going to another program.
- Save the file with Download .xlsx or Download .csv, then total one amount column against the total printed in the PDF.
Example
Settings for invoice-30726.pdf (page 1 typed, page 2 a scanned delivery note)
Output format: Excel workbook (.xlsx)
Sheets: One sheet per page
Rows to keep: Keep all text, titles and notes too
Numbers: Detect the number style
Pages: all
Page 1 as printed:
Northwind Office Supply
Invoice INV-30726, issued 2026-10-03
SKU Description Qty Unit price VAT Amount
00731 Ergonomic office chair, 4 $289.00 20% $1,156.00
mesh back, black
01244 Monitor arm, dual 2 $74.50 20% $149.00
00918 Desk mat 6 $18.25 5% $109.50
Total $1,414.50Result
invoice-30726.xlsx
2 pages in · 412 KB → 7 KB · 8 rows · 1 sheet
Page 2 has no text and was left out.
Sheet "Page 1", values as stored:
1 Northwind Office Supply
2 Invoice INV-30726, issued 2026-10-03
3 SKU | Description | Qty | Unit price | VAT | Amount
4 00731 | Ergonomic office chair, | 4 | 289 | 0.2 | 1156
5 | mesh back, black | | | |
6 01244 | Monitor arm, dual | 2 | 74.5 | 0.2 | 149
7 00918 | Desk mat | 6 | 18.25 | 0.05 | 109.5
8 | | | Total | | 1414.5
SKUs stay text; 289 shows as $289.00, 1156 as $1,156.00, 0.2 as 20%.
As CSV, row 4 is: 00731,"Ergonomic office chair,",4,289.00,0.20,1156.00Tips for best results
- If a European document prints only whole amounts like 1.250 and 12.750, set Numbers to 1.234,56 yourself. Those figures fit both styles, so detection falls back to 1,234.56 and stores 1.250 as 1.25, which its three-decimal format still displays as 1.250; only a total or the formula bar gives it away.
- Choose the workbook if the file will be opened in Excel: opening a CSV makes Excel re-guess every column and turn 00731 into 731, while the .xlsx already stores codes as text and amounts as numbers.
- Type a range such as 4-9 in Pages to skip the cover and notes; a page in the range without text is named in a warning and left out.
- For a table spanning several pages, choose All pages on one sheet, then filter out the running headers and repeated column titles, which arrive as rows.
- Only rows with two or more columns is the quickest route to a bare table: it drops titles, captions and paragraphs but keeps the second lines of wrapped descriptions.
Edge cases to watch
Scanned PDFs have no text to read; the tool reads stored text, never the pixels of a page image.
A cell whose text wraps onto two lines comes out as two rows, the continuation in the same column below; join them with =B4&" "&B5 and delete the spare row.
Two different tables stacked close together with only a caption between them share one set of columns; a gap of more than 2.5 line spaces gives each its own.
Merged header cells come out as plain cells, in the column under their left edge or as a one-cell row in column A.
Charts and images are not read: a table pasted in as a picture yields nothing, and a vector chart's labels arrive as loose rows.
Bank statements keep their page layout here, balances and page totals included; the bank statement converters turn them into transaction rows instead.
Common errors and how to fix them
- This PDF has no text to read. It is probably a scan or a photo of a document; PDF to Excel only reads text stored in the file.
- None of the selected pages has a text layer. OCR software can add the recognised words as text, and the OCR'd copy then converts, with columns as accurate as the recognition placed them; a Pages range covering only scanned pages gives the same message.
- No rows with two or more columns were found. Choose “Keep all text” to export every line.
- The selected pages hold prose, a list or a single column of figures. Switch Rows to keep to Keep all text, titles and notes too and every line becomes a one-cell row.
- Page 2 has no text and was left out.
- The conversion still succeeds: that page is an image, such as a signed scan at the end of a contract, and gets no sheet while the rest converts. Several are listed together, as in Pages 3, 7-8 have no text and were left out.
- This PDF is password-protected. Open it with Unlock PDF first, then try again.
- Text can only be read after the file is opened, and pdf.js cannot open an encrypted file without its password. Unlock PDF removes it when you know it; convert the copy it saves. Copy restrictions alone do not stop the tool, so a document you can open freely converts directly.
- This PDF could not be read. It may be damaged; try opening and re-saving it in a PDF viewer.
- pdf.js could not parse the file or one of its pages. Save a fresh copy from a desktop viewer and check that its text can still be selected, since printing to PDF occasionally turns text into shapes.
Best practices
- Check one total: add up an amount column and set it against the total the PDF prints; a mismatch points to the wrong number style or a figure left as text, such as one with a footnote mark.
- Convert the PDF that the accounting or reporting software produced, not a printed-and-scanned copy; only stored text can be read.
- Keep the PDF as the record; the sheet is a reconstruction for analysis, and in an audit the issued PDF is what counts.
How titles, wrapped cells and captions are told apart
The hardest lines in a PDF table hold a single piece of text: a title, a caption between tables, a section heading such as Transfers between your own accounts, or the second line of a wrapped description. Position decides. A one-cell line that reaches across a gap no multi-cell line of its group touches, or appears above the group's first multi-cell line, unless it lies wholly inside a later column the way a lone Amount heading does, is a title or caption and becomes a one-cell row in column A. One that sits within the columns, typically under Description, is a wrapped cell: it gets its own row, its text goes into the column it sits in, and Only rows with two or more columns keeps it.
Bulleted and numbered notes, a marker followed by text, are handled like one-cell lines and never shape the columns, while a marker followed by a bare number, such as a nil dash beside 1,250, is a table row. A section heading never cuts a table in two, because columns are worked out once per group, so a statement with a heading halfway down keeps its Balance column in place. The price is that two different tables separated only by a caption at ordinary line spacing share one set of columns, and the second may need tidying by hand.
Frequently asked questions
Can it convert a scanned PDF?
No. A scan stores each page as an image, and the tool reads only text stored in the file, so the run ends with a sentence explaining why. An OCR'd copy carries the recognised words as text and converts, though any digit the OCR misread carries into the sheet.
Why does one description take up two rows?
The PDF wrapped it, and every printed line becomes a row: the continuation lands in the same column on the next row with its other cells empty. The tool keeps the lines apart rather than guess which belong together, so join them where it matters.
Does it keep merged cells, colours and charts?
No. Merged header cells come out as plain cells, fonts, colours and borders are dropped, and charts and images are ignored. Two different tables stacked with only a caption between them may also share one set of columns.
Should I use it for bank statements?
For a statement headed into accounting software, use one of the bank statement converters, such as Bank Statement (PDF) to Excel, which turn each transaction into a row with its date, description and amount. PDF to Excel copies the page as laid out: right for invoices, reports and price lists, and for a statement only when you want its layout.