How to Copy a PDF or Web Table into Excel Without Losing Formatting
Question details
The user wants to copy data tables from PDF files or websites into Excel while retaining the original spacing and formatting.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Importing or copying table data from an external source (PDF or Web) into a spreadsheet.
- Observed behavior
- Pasting the table directly into Excel or Notepad causes the data to lose its original layout, spacing, and formatting, particularly when the table contains empty cells.
Ensure you have the source PDF document saved locally on your computer, or copy the URL if extracting from a web page, and verify that the table data is clearly structured.
Import PDF or CSV Data Using Excel's Get Data Feature
Using Excel's built-in Get Data feature ensures that data structures, including empty cells and columns, are preserved correctly during the import process.
Directly pasting tables often ignores column breaks. By using the Power Query (Get Data) tool, Excel processes the background structure of the source file to maintain the correct layout.
If dealing with a web table, save the extracted data as a text or CSV file first. If dealing with a PDF, ensure it is saved securely on your device.
Open Excel, navigate to the 'Data' tab on the top ribbon menu, and click on 'Get Data' (or 'New Query' in older versions).
Choose 'From File' and then select 'From Text/CSV' or 'From PDF' (if available in your Office version). Browse your computer to locate and select the file.
A preview window will appear. If the layout looks correct, click 'Load'. If you need to fix empty cells or shift columns, click 'Transform Data' to adjust the layout in Power Query before loading it into your spreadsheet.

Use a Dedicated PDF-to-Excel Conversion Tool
A reliable PDF-to-Excel conversion tool automatically extracts tables and preserves their formatting, bypassing manual text adjustments.
Effortlessly Convert PDF Tables to Excel with WPS Office
WPS Office features a built-in PDF toolkit that allows you to seamlessly convert PDF files directly into editable Excel spreadsheets. It accurately recognizes table structures, preserving the original formatting and cell layouts without requiring complex data import queries.
- 1. Open the PDF File: Launch WPS Office and open the PDF document that contains the table you wish to extract.
- 2. Select PDF to Excel: Navigate to the 'Tools' tab on the top ribbon and click on the 'PDF to Excel' option.
- 3. Configure the Conversion: In the pop-up window, select the specific pages containing the tables you need, and choose your desired output location.
- 4. Convert and Edit: Click 'Convert'. The file will automatically open as a perfectly formatted spreadsheet in WPS Spreadsheet, ready for editing.

Frequently Asked Questions
Why does my PDF table paste into a single column in Excel?
When you paste directly, Excel often reads PDF text as a continuous string without column delimiters. Using the 'Get Data' feature or a dedicated PDF-to-Excel converter forces the program to recognize proper table structures.
Can I extract only a specific table from a multi-page PDF?
Yes. When using the 'Get Data' feature in Excel, the Navigator window lets you select the specific table or page you want to import. Similarly, most PDF converters allow you to specify an exact page range.
How do I import a table directly from a website into Excel?
Go to the 'Data' tab, select 'Get Data', choose 'From Other Sources', and click 'From Web'. Paste the URL of the webpage, and Excel will scan the site to detect and extract HTML tables.
What if the PDF contains scanned images instead of text?
If the PDF is an image or scanned document, standard copy-pasting or basic importing will not work. You will need to use a PDF tool equipped with OCR (Optical Character Recognition) to identify and extract the visual text into an editable Excel table.




