To import a TXT file into Excel, open Excel, go to the Data tab, click From Text/CSV, select your file, then use the Text Import Wizard or Power Query to set delimiters and column formats before loading the data. This works in Excel for Microsoft 365, Excel 2019, 2021, and 2024 on Windows and Mac. You will need the TXT file saved on your computer or accessible via a network path, and a basic idea of how the data is separated (tabs, commas, semicolons, or fixed width).

What You'll Need

  • Microsoft Excel installed (desktop version recommended; Excel for the web has limited import options).
  • The TXT file saved locally or on a drive you can access.
  • Knowledge of the delimiter used in the file (e.g., tab, comma, semicolon, pipe). If unsure, open the file in Notepad or TextEdit to inspect it.
  • For very large files (over 1 million rows), consider using Power Query or a database tool; Excel has a row limit of 1,048,576.

Step-by-Step

  1. Open Excel and create a new blank workbook or open an existing one where you want the data.
  2. Go to the Data tab on the ribbon. The exact labels may differ slightly by version, device, or region.
  3. Click “From Text/CSV” (in the Get & Transform Data group). On Mac, it may be under Data > Get Data > From Text/CSV.
  4. Browse to your TXT file and click Import. Excel will preview the first few rows.
  5. In the preview window, check the File Origin (usually 65001: Unicode UTF-8 or Windows (ANSI) depending on the file). If you see garbled characters, try a different encoding.
  6. Set the Delimiter from the dropdown: choose Tab, Comma, Semicolon, Space, or a custom character. If the data is fixed-width, choose Fixed Width instead. The preview updates to show columns.
  7. Review the column data types (e.g., Text, Date, Whole Number). You can click each column header to change the type. This prevents Excel from misinterpreting values like “001” as numbers.
  8. Click Load to import the data into a new worksheet, or click Transform Data to open Power Query Editor for more cleaning (e.g., removing blank rows, splitting columns).
  9. Verify the imported data by checking that columns align correctly and no rows are missing. If something is off, you can undo (Ctrl+Z) and re-import with different settings.

Common Mistakes

  • Wrong delimiter: If all data lands in one column, the delimiter is likely incorrect. Re-import and select the right one.
  • Encoding issues: Special characters (e.g., é, ü) may appear as gibberish if the wrong file origin is chosen. Try UTF-8 or the encoding used when the file was saved.
  • Leading zeros lost: Excel may drop leading zeros from numbers. Set the column type to Text before loading.
  • Date misinterpretation: Dates like 01/02/2023 may be read as January 2 or February 1 depending on locale. Set the column type to Date and specify the format if needed.
  • Importing into an existing sheet: Using “From Text/CSV” always creates a new table or worksheet; if you need to append to existing data, use Power Query or copy-paste after import.
  • Ignoring row limits: Excel cannot handle more than 1,048,576 rows; larger files will be truncated. Split the file or use Power Pivot.

Tips

  • Use Power Query (Data > Get Data > From File > From Text/CSV) for repeatable imports; you can refresh the query when the TXT file changes.
  • If the file has a header row, ensure “First Row as Headers” is checked in the preview (or in Power Query).
  • For fixed-width files, you can drag column markers in the preview to set breaks.
  • Save your import steps as a query so you can reuse them with other similar files.
  • If you only need a quick look, you can open the TXT file directly in Excel (File > Open) and the Text Import Wizard will appear automatically.

Troubleshooting

  • Data appears in one column: The delimiter is not set correctly. Re-import and choose the correct delimiter, or use Fixed Width if appropriate.
  • Garbled characters: Change the File Origin to a different encoding (e.g., from UTF-8 to Windows (ANSI) or vice versa).
  • Excel crashes or hangs: The file may be too large. Try importing a smaller sample first, or use Power Query with “Load To” > “Only Create Connection” to avoid loading all data at once.
  • Numbers formatted as text: In the preview, set the column type to Whole Number or Decimal Number. Alternatively, after import, use Text to Columns or VALUE function.
  • Dates not recognized: Set the column type to Date and specify the order (e.g., MDY, DMY).
  • Import button greyed out: Ensure the file is not open in another program and that you have write permissions to the destination workbook.

Frequently Asked Questions

Can I import a TXT file into Excel on Mac?

Yes. The steps are similar: go to Data > Get Data > From Text/CSV. The interface may look slightly different, but the options for delimiter and data types are the same.

What if my TXT file uses a delimiter not listed?

In the preview window, you can type a custom delimiter in the “Other” box. For example, if your file uses a pipe (|), enter it there.

How do I import only part of a TXT file?

Use Power Query: after selecting the file, click Transform Data, then filter rows or remove columns as needed before loading.

Can I import a TXT file into Excel for the web?

Excel for the web has limited import options. You can open the TXT file directly, but for full control use the desktop version.

Why does Excel change my numbers to dates?

Excel auto-detects data types. To prevent this, set the column type to Text in the import preview.

Is there a limit to the size of TXT file I can import?

Excel can handle up to 1,048,576 rows and 16,384 columns. Files larger than that will be truncated; consider using Power Pivot or a database.