TextToTable

Convert TXT File to Excel

Wondering how do you convert a txt file to excel? Upload your .txt file or paste your raw text below. We detect your delimiters and let you copy straight into Excel or download an XLSX spreadsheet.

1Paste or Upload
→
2Preview & Edit
→
3Copy / Export
Input Text
Try Sample:
Supported:Tabs (TSV)Commas (CSV)Pipes (|)Notepad Spaces
Paste your text above, then click Convert to preview your table

Two Ways to Convert a TXT File to Excel

When you have a .txt file containing rows of data, there are two primary methods to convert it into a Microsoft Excel spreadsheet: using Excel's built-in file import or using a dedicated browser converter. Understanding both approaches helps you decide which is faster for your workflow.


Method 1: The Browser-Based Converter (Fastest & Easiest)

If you need to quickly convert txt file to excel without fiddling with import dialogs, TextToTable provides an instant client-side pipeline:

  1. Drag your .txt file onto the box above or click "Upload TXT".
  2. TextToTable immediately scans your records and identifies the delimiter (whether tab, comma, semicolon, or spaces).
  3. Review the interactive table. Edit any values directly if necessary.
  4. Click "Copy to Excel" to copy the table to your clipboard as tab-separated values (TSV).
  5. Open Excel or Google Sheets, click cell A1, and press Ctrl+V. Your table is ready. Alternatively, click "Download XLSX" to save an Excel workbook file directly.

Method 2: Excel's Built-In Import Method

If you prefer to perform txt to excel conversion using Microsoft Excel's native desktop application:

  1. Open Microsoft Excel and go to the Data tab on the top ribbon.
  2. Click From Text/CSV (or in older versions of Excel, click From Text).
  3. Browse to your .txt file and select Import.
  4. A preview dialog will appear. Excel will attempt to identify the delimiter. If the columns appear mangled, manually select the appropriate delimiter from the dropdown.
  5. Click Load to import the data onto a new worksheet.

Common Pitfall with Excel's Native Import:

Excel's Power Query importer often attempts to auto-convert data types. This can unintentionally strip leading zeroes from postal codes, employee IDs, and account numbers (converting 00451 to 451), or misinterpret European date formats. To learn how to bypass these errors, see our detailed guide on the Excel Text Import Wizard.


How Delimiter Detection Works (With a Simple Example)

Suppose you have a simple list copied from a database dump or text file:

Input: Raw Comma-Separated Text

John,25,Lahore
Sarah,28,Karachi
Ali,31,Islamabad

Output: Structured 3-Column Table

NameAgeCity
John25Lahore
Sarah28Karachi
Ali31Islamabad

Here is what TextToTable does behind the scenes:

  • Counts separators across lines: It checks tabs, commas, pipes, semicolons, and spaces. In this example, each line consistently has 2 commas.
  • Extracts columns: It recognizes that each row contains 3 distinct items (Name, Age, City).
  • Formats for Excel paste: When you click "Copy to Excel", the tool joins the columns with tab characters (\t). When you press Ctrl+V in Excel, Excel splits tabs into cells across columns A, B, and C instead of dumping everything into column A.

When Automatic Detection May Struggle (Honest Limitations)

Automatic detection uses statistical heuristics, not psychic ability. Here are realistic scenarios where the auto-detector might guess wrong, and how to handle them:

1. Commas inside unquoted text

If someone enters John Doe, Jr.,25,Lahore without quotes around the name, the parser sees 3 commas and creates 4 columns instead of 3. Fix: Click the cell in the live table preview to edit it, or wrap the name in quotes ("John Doe, Jr.") before parsing.

2. Mixed delimiters

If some lines use tabs while others use commas or multiple spaces, the auto-detector selects whichever delimiter appears most consistently. Fix: Click "How should we split the columns?" above the preview table and manually choose the delimiter intended for your data.

3. Completely unformatted prose

If your text is a narrative email or unstructured paragraphs without consistent line breaks or separators, no software can reliably guess column boundaries. The tool is built for structured and semi-structured tabular records.


More Complex Data: Pipe-Separated System Exports

Beyond simple comma-separated lists, raw system exports frequently use pipe delimiters (|) with currency values:

Input: Raw Inventory Export (.txt)

SKU|Product Description|Warehouse|Unit Cost|Quantity In Stock
SKU-00142|Industrial Ball Bearing (12mm)|WH-East|$14.50|1,200
SKU-00891|Hydraulic Seal Ring|WH-Central|$3.85|4,550
SKU-00923|Stainless Steel Hex Bolt M8|WH-West|$0.75|18,000

Output: Converted Excel Table

SKUProduct DescriptionWarehouseUnit CostQuantity In Stock
SKU-00142Industrial Ball Bearing (12mm)WH-East$14.501,200
SKU-00891Hydraulic Seal RingWH-Central$3.854,550
SKU-00923Stainless Steel Hex Bolt M8WH-West$0.7518,000

Key Benefits of Converting TXT to Excel Online

  • Prevents Data Type Corruption: Excel's Power Query importer often strips leading zeroes (e.g. converting postal code 01234 to 1234). TextToTable maintains values as text to keep codes intact.
  • True Native XLSX Generation: TextToTable generates a genuine Microsoft Excel .xlsx workbook right in the browser using SheetJS.
  • Instant Delimiter Switching: Whether your file uses tabs, pipes (|), commas, or semicolons, you can switch delimiters on the fly and see the grid update in real time.
  • Zero Cloud Upload: Your `.txt` file never travels over the wire. The conversion runs inside your browser's local sandbox for complete privacy.

How to Convert TXT File to XLS vs. XLSX

Users searching for how to convert txt file to xls are often working with older spreadsheet software or legacy enterprise databases that require the .xls binary file extension (Excel 97–2003) rather than the modern OpenXML .xlsx extension.

With TextToTable, you can either:

  • Use "Copy to Excel" to paste directly into an existing .xls workbook with zero file conversion steps.
  • Use "Download XLSX", open the resulting workbook in Excel, and choose File → Save As → Excel 97-2003 Workbook (*.xls).

Explore related guides & resources:

Frequently Asked Questions About TXT to Excel

Common questions about converting .txt files, delimiters, and exporting to XLSX.

What character encodings are supported when uploading a TXT file?

TextToTable supports UTF-8, UTF-16, and standard ASCII/ANSI encodings. The browser's native FileReader API streams text data directly into memory, preserving international accent marks, symbols, and multilingual text.

Why does Excel convert long ID numbers from a TXT file into scientific notation (e.g. 1.23E+11)?

When opening a TXT or CSV file directly, Excel's default type engine converts numeric strings of 12 or more digits into scientific notation, permanently losing trailing precision. TextToTable's 'Download XLSX' feature flags numeric identifier columns as explicit text strings (@), preventing Excel from altering numbers.

How large of a TXT file can I convert in the browser?

Because TextToTable executes client-side within your browser's JavaScript engine, it comfortably parses TXT files containing tens of thousands of rows in under a second, without hitting external upload size caps or server timeout errors.

Will converting a TXT file modify or overwrite my original file on disk?

No. The browser reads the contents of your TXT file into local memory for parsing. Your original source file remains completely untouched on your storage drive.

What delimiter should I choose if my TXT file was exported from a database or ERP system?

Database and mainframe dumps commonly use pipe (|) or tab characters to avoid colliding with commas in addresses and text fields. TextToTable automatically scores and detects these separators, or you can manually select 'Pipe' or 'Tab' from the options menu.

How do I convert a TXT file to XLSX without having Microsoft Excel installed?

Upload your TXT file into TextToTable, review the detected columns in the table preview, and click 'Download XLSX'. TextToTable generates an authentic OpenXML spreadsheet (.xlsx) directly in your browser that opens in Google Sheets, LibreOffice, or Microsoft 365.