Excel can open .txt files, but how you do it matters for keeping your data intact

When you double-click a .txt file, Windows or Mac will usually open it in Notepad or a text editor instead of Excel. To open it in Excel without losing formatting or splitting data into the wrong columns, you need to use Excel's import process rather than just opening the file. This takes about two minutes and gives you control over how Excel reads the data.

The reason this matters: if your .txt file contains data separated by commas, tabs, or spaces, Excel needs to know which separator to use. If you skip this step, all your data might land in a single column instead of spreading across multiple columns the way you intended.

Key Takeaways

  • Open Excel first, then use File > Open to import the .txt file rather than double-clicking the file itself.
  • The Text Import Wizard will appear and ask you to choose a delimiter — the character that separates your data into columns, usually a comma, tab, or space.
  • You can preview how your data will look in the wizard before you finish, so you can go back and change the delimiter if it looks wrong.
  • Once imported, save the file as .xlsx if you want to keep it in Excel format, or leave it as .txt if you need to share it with programs that only read text files.

How to import a .txt file into Excel on Windows

Start by opening Excel itself — do not double-click the .txt file. Once Excel is open, go to the File menu in the top left and click Open. A dialog box will appear asking you to choose a file. Navigate to your .txt file and select it, then click Open.

Excel will now show you the Text Import Wizard, a three-step window that appears only when you import a text file this way. In Step 1, you will see options for how the file is organized. Most .txt files use one of three delimiters: comma, tab, or space. Look at the preview at the bottom of the window — it shows you how your data will look. If your data is already in the right columns in the preview, you are set. If everything is bunched into one column, check the box next to the delimiter that matches your file (Comma, Tab, or Space). The preview will update when ready.

Click Next to move to Step 2, where you can adjust the data type for each column if needed — usually you can leave this as General and click Next again. Step 3 lets you choose where the data lands in your spreadsheet. The default is fine for most people. Click Finish, and your data will appear in Excel as a spreadsheet.

How to import a .txt file into Excel on Mac

On Mac, the process is nearly identical. Open Excel, click File in the menu bar, and select Open. Find your .txt file and click Open. The Text Import Wizard will appear with the same three steps.

In Step 1, look at the preview and choose your delimiter — Comma, Tab, or Space — based on what you see. The preview updates as you click each option, so you can see when ready if you chose correctly. Click Next, leave Step 2 as is unless you have a specific reason to change data types, and click Next again. In Step 3, confirm the destination and click Finish.

What to do if your data does not split into columns correctly

If you finish the import and all your data is still in column A instead of spreading across columns, you chose the wrong delimiter. Go back to File > Open, select the same .txt file again, and the Text Import Wizard will reappear. This time, try a different delimiter. If your file uses commas and you chose Tab, switching to Comma will fix it when ready in the preview.

If none of the standard delimiters work, your file might use a character like a pipe symbol (|) or semicolon. In Step 1 of the wizard, look for a field labeled "Other" with a blank box next to it. Type the character your file actually uses, and the preview will show you the result. Once it looks right, click Next and Finish.

Saving your file after importing

After you import the .txt file and see your data in Excel, you can save it in two ways. If you want to keep working with it as an Excel file, go to File > Save As and choose Excel Workbook (.xlsx) as the file type. This preserves any formatting or formulas you add.

If you need to send the file to someone who only has access to text editors, or if the original was .txt and you want to keep it that way, go to File > Save As and choose Text (Tab-delimited) or Text (Comma-delimited) depending on your delimiter. Excel will warn you that some features may be lost — this is normal and just means formulas or colors will not survive the conversion back to plain text. Click Save anyway if that is what you need.

Common reasons the import goes wrong

The most common mistake is double-clicking the .txt file instead of opening Excel first. When you double-click, your computer opens it in Notepad or another text editor, not in Excel, so you never see the import wizard. Always open Excel first, then use File > Open.

The second common issue is choosing the wrong delimiter. If your preview shows all data in one column, you picked the wrong separator. Go back and try again — the wizard lets you change your choice as many times as you need before you click Finish.

A third issue happens when your .txt file has a header row (like "Name, Address, Phone") and Excel treats it as data. In Step 1 of the wizard, you can check a box that says "My data has headers" if your file does. This tells Excel to treat the first row as column labels instead of data.

When to convert .txt to .xlsx instead of just opening it

If you plan to use the file only in Excel and will not need to share it with other programs, convert it to .xlsx format. This lets you add formulas, charts, and formatting without worrying about losing your work if you save over the original .txt file.

If you need to share the file with people who use different programs, or if the original source keeps updating the .txt file and you want to re-import it regularly, leave it as .txt. You can always re-import it into a fresh Excel sheet whenever you need an updated version.

Frequently Asked Questions

Can I just rename a .txt file to .xlsx and open it in Excel?

No. Renaming the file does not change what is inside it. Excel will either refuse to open it or open it incorrectly because the file structure is still plain text, not an Excel spreadsheet. Always use File > Open and go through the import wizard instead.

What if my .txt file has data in a format Excel does not recognize?

In Step 2 of the Text Import Wizard, you can set each column to a specific data type — Text, General, Date, or Do Not Import. If a column contains dates in an unusual format, setting it to Text will preserve it exactly as written. If you want Excel to treat it as a date, choose Date and select the format that matches your file.

Will importing a .txt file change the original file?

No. Importing creates a copy in Excel. Your original .txt file stays exactly as it was. If you make changes in Excel and save as .xlsx, the .txt file remains untouched. Only if you explicitly save over it as .txt will the original change.

Can I import multiple .txt files at once?

Excel does not have a batch import feature. You will need to open each .txt file separately using File > Open. However, once you import the first file and set your delimiter, Excel will remember that choice for the next file you import in the same session.

Why does Excel show my numbers as text after importing?

This usually happens when the .txt file stores numbers with leading spaces or special formatting. In Step 2 of the Text Import Wizard, select the column containing numbers and change its data type from Text to General. Excel will then treat them as numbers, which matters if you plan to do math with them.