How to Insert a Text File Into Excel

If you just need to insert a text file into excel and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: use Data ▸ Get Data ▸ From Text/CSV, check the delimiter and encoding in the preview, then Load — or click Transform Data first to set columns like leading-zero IDs to Text.

Annotated stepsExcel
1

Go to Data ▸ Get Data ▸ From File ▸ From Text/CSV and pick the .txt file.

2

Check the preview: Excel guesses the delimiter — switch between Tab, Comma, and Semicolon until the columns line up.

3

If accented characters look garbled, set File Origin to 65001: Unicode (UTF-8).

4

Click Transform Data and set ID or phone columns to Text in Power Query so leading zeros survive.

5

Click Close & Load to put the data on a sheet; Refresh re-reads the file later.

6

For text already pasted into one column, use Data ▸ Text to Columns and choose Delimited or Fixed width.

Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

From Text/CSV reads a .txt or .csv file through Power Query: it previews the data, guesses the delimiter (tab, comma, semicolon), lets you pick the encoding, and loads the result as a refreshable query. The legacy Text Import Wizard does the same job with fixed-width support and per-column types, but is hidden until you re-enable it under File ▸ Options ▸ Data. Text already pasted into one column is split with Text to Columns instead. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “insert a text file into excel”. Start on a copy or a tiny sample, keep the affected cells visible, and compare the result with the tool above before you touch the real workbook. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. The point is a data step that keeps your analysis trustworthy, but the practical win is that someone else can open the file and understand what happened without asking you.

A worked example

orders.txt contains tab-separated lines like 007→Bolt M8→42. Data ▸ Get Data ▸ From Text/CSV detects the tab delimiter and shows three columns; click Transform Data, set the first column's type to Text, then Close & Load — the ID stays 007 instead of collapsing to 7. Exports from databases, loggers, and legacy systems arrive as plain text; a controlled import gets them into rows and columns without losing zeros, dates, or special characters. One habit worth forming early: name the cells that hold your inputs, so the formula reads in plain language instead of a string of cell addresses. A reviewer — or you in three months — can then follow the logic without decoding what B7 and D2 were supposed to mean, which is most of what makes a sheet maintainable.

In Google Sheets

Everything above works in Google Sheets too. Excel and Sheets share the formula syntax used here; only the surrounding menus are arranged differently. That portability is deliberate — learn it once and it follows you between the two tools and across Windows and Mac. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. The short version of “insert a text file into excel”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Loading ID columns as numbers, which strips leading zeros — set the column type to Text first.
  • Accepting the guessed delimiter when the file actually uses semicolons.
  • Garbled umlauts or accents from the wrong encoding — choose 65001: UTF-8 as File Origin.
  • Choosing Fixed width for a delimited file (or the reverse), which shreds the columns.
  • Hunting for the old Text Import Wizard — re-enable it under File ▸ Options ▸ Data ▸ legacy import wizards.

Frequently asked questions

From Text/CSV or the legacy Text Import Wizard?

From Text/CSV is the modern default: live preview, Power Query transforms, refreshable result. The legacy wizard survives under File ▸ Options ▸ Data if you need its exact old behavior.

How do I keep leading zeros when importing?

Click Transform Data in the import dialog and set the column type to Text before loading. Once a zero is dropped by a number conversion, it is gone.

How do I import a text file into Google Sheets?

File ▸ Import ▸ Upload, pick the .txt file, and leave the separator type on "Detect automatically" or choose tab/comma/custom.

Other ways people ask this

This is also commonly searched as “how to insert text file in excel” and “how to insert text file into excel”. They describe the identical operation, so you are in the right place no matter how you phrased it.

Why do people search for this in so many different ways?

Because the same task has many names. “how to insert text file in excel”, “how to insert text file into excel” all point at the one operation explained on this page, which is why they all lead here.