Skip to footer content
EXCEL TOOLS

How to Convert TXT to Excel: 8 Methods That Work (2026)

A text file landed in the inbox, and it needs to be a spreadsheet by the end of the hour. The quickest way to convert TXT to Excel is to open Excel, go to the Data tab, click From Text/CSV, choose the .txt file, check the preview, click Load, then save the result as an Excel Workbook (*.XLSX). Microsoft Excel reads txt files natively, so no download, no online converter, and no IT ticket is required.

That approach handles the majority of everyday text files for people who need a usable spreadsheet fast, whether the file came from an accounting export, a database feed, or any recurring plain-text report that would be easier to work with in Excel. The keyboard route is faster once it becomes muscle memory: press Alt + A, then F, then T to open the same import dialog straight from the Data tab.

Most files import cleanly, including tab-delimited exports, a comma-separated CSV file renamed by a colleague, or a pipe-delimited feed from a database. Where files get messy is in the details: a column of ZIP codes that loses its leading zeros, a date that arrives in the wrong order, or accented characters that turn into question marks. Those fixes appear in the troubleshooting section further down and follow the same logic as other post-import cleanup work, such as combining two columns into one.

It also helps to know what happens after the import. Long text values overflow their cells until text wrapping is enabled, and a large imported sheet becomes much easier to read once the header row is frozen in place. Both take a few seconds and save a lot of scrolling later.

Below is the complete list of methods that work: Data > From Text/CSV, the legacy Text Import Wizard, drag-and-drop, copy-paste with Text to Columns, renaming to CSV when appropriate, Power Query for repeatable imports, VBA macros for batch conversion, and alternatives such as Google Sheets and LibreOffice Calc. That range matters when a raw text export needs to become a working spreadsheet with structure, formatting, and formulas quickly, especially if the data is sensitive, recurring, or too important to risk with a third-party converter.

TXT file, CSV and XLSX: What Actually Changes

A txt file holds plain text and nothing else. Most are ASCII or UTF-8, written by an export routine or typed in a text editor. Every row sits on its own line and columns are separated by tabs, commas, semicolons or fixed character widths. No formatting, no formulas, and no metadata are stored anywhere in the file.

File type What it stores Main limitation
.txt Plain text, one line per row No formulas, formatting or charts
.csv Plain text with comma separators Same limits as txt
.xls Legacy binary Excel workbook Capped at 65,536 rows
.xlsx XML-based workbook, the standard format since Excel 2007 Capped at 1,048,576 rows

Most working spreadsheets start life as an export like this. The XLSX conversion is what unlocks everything Excel is actually good at: formulas, cell styles, charts, multiple sheets, filtering and sheet protection. An XLSX file also keeps metadata such as author, sheet names and column widths, none of which a text file can hold.

People searching for XLSX txt conversion are usually going in one of two directions: turning a raw export into a working spreadsheet, or stripping a workbook back down to plain text for a system that only accepts flat files. This page covers the first direction.

Method 1: Data > From Text/CSV (The Modern Default)

This is the current import engine in Microsoft 365 and Excel 2016 onward, and it handles most files without any configuration.

  1. Create a blank workbook.
  2. Go to Data > From Text/CSV.
  3. Browse to the text file and click Import.
  4. A preview window appears showing File Origin, Delimiter, and Data Type Detection.
  5. Confirm the delimiter looks right in the preview, then click Load.

Excel drops the data into a new sheet as a formatted table. Save the file as .XLSX to complete the conversion.

Choosing Transform Data instead of Load opens the Power Query Editor, where columns can be retyped, trimmed or removed before anything reaches the worksheet. That extra step is worth taking whenever the file contains ID numbers, postcodes or dates.

Data tab ribbon with the From Text/CSV button highlighted, plus the import preview window

Method 2: File > Open and the Text Import Wizard

The classic route still works and gives the most granular control over each column.

  1. In Excel, press Ctrl + O and click Browse.
  2. In the file type dropdown next to the filename box, change All Excel Files to All Files (*.*) or Text Files.
  3. Select the txt file and click Open.
  4. The Text Import Wizard opens in three steps: choose Delimited or Fixed Width, tick the delimiter, then proceed to step 3 and set the data format for each column.
  5. Click Finish.

Step 3 is the important one. Select a column in the preview pane, then choose Text to protect leading zeros, or Date with the correct order (DMY, MDY, YMD) to stop dates from being misread.

Double-clicking a text file in File Explorer opens Notepad rather than Excel, so this import has to be started from inside Excel.

Step 3 of the Text Import Wizard with one column selected and the Text radio button circled

If the Wizard does not appear

Some Microsoft 365 builds send every text file through Power Query instead. To restore the wizard, go to File > Options > Data, tick From Text (Legacy) under "Show legacy data import wizards", then use Data > Get Data > Legacy Wizards > From Text (Legacy).

Method 3: Drag and Drop

The fastest method of all when the file is already visible on the desktop.

Open Excel, then drag the txt file from its folder location onto the Excel window. Excel opens it as a workbook and, depending on the version, either runs the import wizard or parses the delimiters automatically. Save as .XLSX afterwards.

This works well for tab-delimited files and less well for anything with unusual separators.

A txt file being dragged from a File Explorer window onto an open Excel workbook

Method 4: Copy, Paste, then Text to Columns

Useful when only part of a file is needed, or when the file is open in a text editor already.

  1. Open the text file in Notepad and press Ctrl + A, then Ctrl + C.
  2. Click cell A1 in Excel and press Ctrl + V. Everything lands in a single column.
  3. With the column still selected, press Alt + A, then E to open Text to Columns.
  4. Choose Delimited, click Next, tick the correct separator, click Next.
  5. Set the column formats and click Finish.

Text to Columns is also the repair tool of choice when an import has already gone wrong, and every value is sitting in column A.

Method 5: Rename the File to .CSV

A quick trick for comma-separated text files.

Right-click the file, choose Rename, and change the extension from .TXT to .CSV. Excel then opens it directly on a double-click and parses each comma automatically. File extensions may need to be visible first: in File Explorer on Windows, go to View > Show > File name extensions.

Two caveats apply. Renaming does nothing for tab-delimited or fixed-width files, and Excel applies its automatic formatting rules to a CSV without asking, which is exactly how leading zeros disappear. Reserve this method for simple files where every column is plain text or plain numbers.

Method 6: Power Query for Files that Arrive Every Week

Teams that convert txt files on a weekly or nightly schedule should build the import once and refresh it afterwards.

Import through Data > From Text/CSV, click Transform Data, and use the Power Query Editor to set column types, remove blank rows, trim whitespace, and rename headers. Click Close & Load. From then on, replacing the source file and clicking Data > Refresh All reapplies every step in a couple of seconds.

Power Query also handles whole folders. Use Data > Get Data > From File > From Folder to combine dozens of identically structured text files into one table, with filtering applied before anything loads into the worksheet.

Method 7: A VBA Macro for Bulk Conversion

For a folder of files that all share the same structure, a short macro removes the repetition. Press Alt + F11, insert a module, and paste this code:

Sub ConvertTxtFolderToExcel()
    Dim folderPath As String, fileName As String
    folderPath = "C:\Exports\"
    fileName = Dir(folderPath & "*.txt")

    Do While fileName <> ""
        Workbooks.OpenText fileName:=folderPath & fileName, _
            DataType:=xlDelimited, Tab:=True, Comma:=False, Semicolon:=False
        ActiveWorkbook.SaveAs folderPath & Replace(fileName, ".txt", ".xlsx"), _
            FileFormat:=xlOpenXMLWorkbook
        ActiveWorkbook.Close
        fileName = Dir
    Loop
End Sub

Adjust the folder path and the delimiter arguments, then press F5. Each output file is saved beside its source. Save the workbook itself as .XLSM if the macro needs to be kept.

Method 8: Google Sheets, LibreOffice Calc and Other Spreadsheet Applications

On a computer without Microsoft Office installed, other spreadsheet applications handle the same job.

Google Sheets: upload the file to Google Drive, right-click and open with Google Sheets, then choose File > Download > Microsoft Excel (.XLSX). Sheets detects most delimiters automatically, and the downloaded workbook opens cleanly in Excel.

LibreOffice Calc: free on Windows, Mac and Linux. Opening a txt file triggers an import dialog close to Excel's wizard, with character set, separator and column type options. Save as Excel 2007-365 (.XLSX) when finished.

Online converter tools exist as well, though anything containing customer records, payroll figures or internal financials should stay off third-party servers. A local conversion takes about the same time and keeps the data in-house.

Common Issues and How to Fix Them

Everything landed in column A. The delimiter was wrong. Select the column and run Text to Columns (Alt + A, then E), or reimport and pick the correct separator. Exports from mainframe and legacy programs are often fixed-width rather than delimited, which means choosing Fixed Width in step 1 and dragging the break lines manually.

Leading zeros disappeared. Excel treats 01234 as the number 1234. During import, set the affected column to Text in step 3 of the wizard, or change its type to Text in Power Query. Formatting the column as Text after the data is already in place will not bring the zeros back.

Dates are wrong or reversed: /2026 reads as 3 April or 4 March depending on system locale. Set the column to Date in the wizard and pick the order that matches the source, or use Using Locale on the column in Power Query.

Long numbers show as 1.23457E+15: Excel stores only 15 significant digits, so a 16-digit account number gets rounded. Import those columns as Text.

Accented characters look like garbled symbols - The encoding is mismatched. In the From Text/CSV preview, set File Origin to 65001: Unicode (UTF-8). In the legacy wizard, choose the same option in the File origin dropdown on step 1.

Rows are splitting in the wrong places - Values containing the delimiter inside quotes need a text qualifier. Set the Text qualifier to the double quote character in step 2 of the wizard.

European number formats are being misread. Files using 1.234,56 need the separators swapped. Click Advanced in step 3 of the wizard and set the decimal separator to a comma and the thousands separator to a period.

Excel refuses to open the whole file. A worksheet holds 1,048,576 rows and 16,384 columns. Larger files need Power Query with a filter applied before loading, or splitting at the source.

The file still says .TXT after import: Opening a text file in Excel does not convert it. Use File > Save As and pick Excel Workbook (*.XLSX) to create a genuine Excel file. Workbooks in that format support formulas, charts, and multiple tabs.

Trailing spaces are breaking lookups: Fixed-width exports pad values with spaces. Apply =TRIM(A2) in a helper column, or use Transform > Format > Trim in Power Query.

Converting TXT to Excel Automatically in an Application

Manual imports work well for a file or two. When the conversion has to run inside a business system, on a server, or overnight without anyone present, it belongs in code instead. Teams solve this in Python and Java as well, though .NET applications have a more direct option.

IronXL handles the job without requiring Microsoft Excel or Office Interop on the machine, which matters on Windows servers, Linux containers, and Mac build agents alike. A delimited text file becomes a real XLSX file in two lines:

using IronXL;

// Load a tab-delimited .TXT file and save it as a real Excel workbook
WorkBook workBook = WorkBook.LoadCSV("quarterly-export.txt", ExcelFileFormat.XLSX, "\t");
workBook.SaveAs("quarterly-export.xlsx");
using IronXL;

// Load a tab-delimited .TXT file and save it as a real Excel workbook
WorkBook workBook = WorkBook.LoadCSV("quarterly-export.txt", ExcelFileFormat.XLSX, "\t");
workBook.SaveAs("quarterly-export.xlsx");
Imports IronXL

' Load a tab-delimited .TXT file and save it as a real Excel workbook
Dim workBook As WorkBook = WorkBook.LoadCSV("quarterly-export.txt", ExcelFileFormat.XLSX, ControlChars.Tab)
workBook.SaveAs("quarterly-export.xlsx")
$vbLabelText   $csharpLabel

Change the third argument to "," or "|" to match the source. For example, an overnight routine can pull every file from a folder, convert each one, apply a house template, and email the results before anyone opens their laptop. From there, the workbook can be styled, given formulas, or edited like any other spreadsheet.

Wrapping Up

For a one-off file, Data > From Text/CSV is the shortest path from plain text to a working spreadsheet. For files with sensitive columns such as IDs, postcodes and dates, the Text Import Wizard gives per-column control that prevents the usual formatting losses. For anything recurring, Power Query turns the whole process into a single Refresh click, and Google Sheets or LibreOffice Calc cover any machine without Excel installed.

Once the data is displayed correctly, the usual cleanup follows: wrapping long text so it stays readable, locking the header row, and clearing any stray dropdown rules inherited from a template.

For more help automating the same conversion inside your own software, the IronXL library is available with a free trial and full instructions in its documentation.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More

Iron Support Team

We're online 24 hours, 5 days a week.
Chat
Email
Call Me