The fastest way depends on what your text looks like
Converting a text document to Excel works differently depending on whether your text is already organized into columns. If your document has data separated by tabs, commas, or spaces — like a list of names and phone numbers with each field in its own column — Excel can import it directly and place each piece into the right cell. If your text is just paragraphs or a messy list, you will need to organize it first or do some manual work in Excel after importing.
The simplest route is usually to open the text file directly in Excel, which will walk you through a dialog that lets you tell Excel where the column breaks are. This takes a few minutes and works for most organized data. If your text is completely unstructured, copying and pasting into Excel and then using Excel's text-to-columns feature is often faster than trying to clean up the original file.
Key Takeaways
- Excel can open .txt files directly and will ask you to specify whether columns are separated by tabs, commas, spaces, or another character.
- If your text file has each field separated by the same character throughout, the import dialog will detect it automatically in most cases.
- For unstructured text, copy and paste into Excel first, then use the Text to Columns feature under the Data menu to split the data.
- Saving the result as an .xlsx file (Excel format) rather than .csv (comma-separated values) preserves formatting and formulas if you add them later.
Opening a text file directly in Excel
Start by opening Excel itself, not the text file. Go to File, then Open, and navigate to your .txt file. Excel will launch the Text Import Wizard, a three-step dialog that shows you a preview of how your data will look.
In step one, choose the delimiter — the character that separates your columns. The most common options are Tab, Comma, Space, or Semicolon. If your data uses tabs (which is common for data copied from tables), select Tab. If it uses commas, select Comma. Excel will show you a preview below the options; if the preview shows your data split into the right columns, you have chosen correctly. If the preview still shows everything in one column, try a different delimiter.
Step two lets you set the data format for each column — whether Excel should treat it as text, a number, or a date. In most cases you can leave this as General and Excel will figure it out. Step three is just a confirmation. Click Finish, and your data will appear in the spreadsheet with each field in its own column.
Using copy and paste with Text to Columns
If your text file is disorganized or you just want to avoid the import dialog, you can copy the text directly into Excel. Open your text document in any text editor (Notepad, Word, or whatever you have), select all the text, copy it, then switch to Excel and paste it into cell A1.
All your text will land in column A. Now select the column by clicking the column header A, then go to the Data menu and click Text to Columns. This opens the same three-step wizard you would see when importing a file. Choose your delimiter, check the preview, and click Finish. Excel will split the data across columns based on where it finds the delimiter character.
This method is useful when you have already cleaned up your text file or when you want to see the raw data in Excel before deciding how to organize it. It also works if your text file does not have a .txt extension and Excel will not recognize it as a text file.
Handling data that is not evenly separated
Sometimes your text has inconsistent spacing or uses different separators in different rows. For example, a list of names might have two spaces between some names and one space between others, or some entries might use commas while others use tabs. In these cases, the import wizard may not split the data perfectly.
After importing or pasting, you can fix individual cells by hand. Click a cell that contains data you want to split, and use the Text to Columns feature again on just that cell or that column. You can also use Excel formulas to extract parts of the text — the LEFT, RIGHT, MID, and FIND functions let you pull out specific characters or words from a longer string. This is more work but gives you complete control over how the data ends up organized.
If you have a lot of messy data, it is often worth spending a few minutes cleaning up the original text file before importing. Use Find and Replace in your text editor to standardize the separators — for example, replace all double spaces with single commas, or replace all tabs with commas. This makes the import much cleaner.
Saving your file in the right format
Once your data is in Excel and organized the way you want it, you need to save it. Excel offers several formats: .xlsx (the standard modern Excel format), .xls (older Excel format), and .csv (comma-separated values, which is plain text). For most purposes, save as .xlsx. This format preserves any formatting you add, any formulas you write, and any other Excel features you might use later.
Use .csv only if you need to share the file with a program that does not read Excel files, or if you plan to import it into another system that expects comma-separated data. .csv files are plain text and will lose any formatting, colors, or formulas when you save. .xls is an older format that some very old programs still use, but there is no reason to choose it for new work.
To save, go to File, then Save As. Choose your location, type a filename, and in the dropdown that says "Save as type", select Excel Workbook (.xlsx). Click Save.
When to clean up the text file first
If your text document has a lot of extra blank lines, inconsistent spacing, or mixed separators, you will save time by cleaning it up before importing. Open the file in a text editor like Notepad (Windows) or TextEdit (Mac), and use Find and Replace to standardize it.
Common fixes: replace all double spaces with single spaces, replace all tabs with commas, remove blank lines, or remove leading and trailing spaces from each line. Most text editors have a Find and Replace dialog under the Edit menu. Type what you want to find, type what you want to replace it with, and click Replace All. After a few passes with different search patterns, your text will be much cleaner and the import will work perfectly.
This approach is especially useful if you are converting the same type of document repeatedly — once you figure out the right sequence of replacements, you can use the same steps every time.
Frequently Asked Questions
What if Excel does not recognize my file as a text file?
If your file has an extension other than .txt, Excel may not open it with the import wizard. Right-click the file, select Open With, and choose Excel. If that does not work, open Excel first, go to File and Open, and navigate to the file manually. You can also change the file extension to .txt before opening it.
Can I convert a PDF to Excel this way?
Not directly — PDFs are not plain text files. You will need to copy the text from the PDF first. Open the PDF in a PDF reader, select and copy the text, paste it into Notepad to clean it up, save it as a .txt file, then follow the steps above. Some PDF readers preserve formatting better than others, so you may need to do extra cleanup.
What if my columns have different separators?
The import wizard can only use one separator at a time. If some columns use commas and others use tabs, clean up the text file first using Find and Replace to make all separators the same. Alternatively, import with one separator, then manually split any columns that did not separate correctly using Text to Columns again on just those columns.
Will formulas or formatting survive the conversion?
No — a plain text file contains only the raw data, no formulas or formatting. Once the data is in Excel, you can add formulas, colors, fonts, and other formatting. If you save as .xlsx, all of that will be preserved. If you save as .csv, it will be lost.
How do I convert Excel back to a text file?
Go to File, Save As, and in the "Save as type" dropdown, choose CSV (Comma delimited) or Tab Delimited Text. Excel will save only the data, not any formatting or formulas. This is useful if you need to share the data with a program that only reads plain text.