What Is a TXT File and How to Create a TXT File on Windows & Mac

5 mins read

Updated on 2026-07-22 15:56:11 to Wiki

Creating a TXT file is one of the most basic but useful computer skills. TXT files are commonly used for notes, programming, configuration files, and storing plain text without formatting. Whether you’re using Windows or Mac, creating a TXT file only takes a few steps.

This guide explains what TXT files are, how to create them using different tools, how to recover lost TXT files, and how to solve common TXT-related problems.

what is a txt file

What Is a TXT File?

Before creating one, it’s helpful to understand what a TXT file actually is. Unlike Word documents or PDFs, TXT files contain only plain text. They don’t support fonts, colors, images, tables, or other formatting, making them lightweight, highly compatible, and easy to edit on almost any operating system.

A TXT file is a plain text document saved with the .txt extension. It stores readable characters using text encoding standards such as ANSI, UTF-8, or Unicode. Since it contains only text, the file size is usually very small and can be opened by nearly every text editor.

TXT files are widely used for:

  • Writing quick notes
  • Saving program logs
  • Creating configuration files
  • Writing scripts and code snippets
  • Sharing plain text without formatting
  • Storing simple documentation

Because of their universal compatibility, TXT files remain one of the most commonly used document formats across Windows, macOS, Linux, and mobile devices.

How to Create a TXT File on Windows?

Windows offers several simple ways to create plain text documents. Depending on your needs, you can use either a graphical application like Notepad or create files directly from the Command Prompt.

Method 1: Create a TXT File Using Notepad

Best For: Everyday text editing, notes, configuration files, and simple coding.

Notepad is the easiest way to create a text document. It comes preinstalled with every Windows computer and is ideal for beginners. Here's how to make a .txt file on Windows:

  • Press "Windows + S" and type "Notepad", then open Notepad from the search results.

  • Type the text you want to save, then click "File" and choose "Save As".

    create a txt file using notepad
  • Choose the folder where you want to save the file and enter a filename followed by .txt and click "Save".
  • Your TXT file is now ready to use.

Method 2: Create a TXT File Using Command Prompt

Best For: Developers, IT administrators, scripting, and batch file creation.

If you prefer working with commands or need to create files quickly, Command Prompt provides a fast alternative. Here’s how to do:

create a txt file with command prompt
  • Press "Windows + R", type "cmd", and press Enter.

  • Navigate to the folder where you want to create the file using the cd command. For example, "cd Desktop"

  • Open File Explorer and navigate to that folder.

  • You should see the newly created TXT file.

How to Make a TXT File on Mac?

Creating text files on macOS is just as simple. You can either use the built-in TextEdit application or create notes that can later be exported as plain text.

Method 1: Create a TXT File with TextEdit

Best For: General writing, notes, and plain text documents.

TextEdit is Apple’s built-in text editor. By switching it to plain text mode, you can easily create a TXT file on Mac.

  • Open TextEdit and click "File" then "New".

  • Select "Format" and click "Make Plain Text".

    make a txt file on mac using textedit
  • Enter your text and save the text file.

Method 2: Make a TXT File Using Apple Notes

Best For: Users who already organize information in Apple Notes.

Although Apple Notes primarily stores notes within the Notes app, you can export them as TXT files.

  • Open the Notes app and create a new note, then type your content.

  • Select the text and copy the content.

    make a txt file using apple notes
  • Open TextEdit and paste it.

  • Convert the document to “Plain Text" by clicking "Format" and choosing "Make Plain Text," and save. This is how to make a .txt file on Mac.

How to Create a TXT File Using Microsoft Word?

Many people already use Microsoft Word daily, so it can also be a convenient option for creating plain text documents. The key is saving the document in TXT format instead of the default DOCX format.

  • Open "Microsoft Word"and create a new blank document.

  • Type your content, then click "File" > "Save As" to choose your save location.

  • Open the "Save as type" drop-down menu and select "Plain Text (.txt)," then click "Save".

    create a txt file using microsoft word
Tip:

Saving as TXT removes all formatting, including fonts, images, tables, and colors. Only plain text is preserved.

⚡How to Recover Lost TXT Files?

TXT files can disappear due to accidental deletion, formatting, system crashes, or unsaved edits. Before assuming they’re permanently lost, try the following recovery methods.

Method 1: Restore TXT Files with Manual Steps

Windows may automatically save temporary versions of documents in certain situations. Checking the AppData folders is a quick first step.

  • Press "Windows + R" and type "%AppData%," then press Enter.

    recover lost txt files with appdata prompt
  • Browse folders such as Microsoft, Roaming, or application-specific folders.

  • Search for the missing TXT filename or recently modified files.

  • If found, copy the file to another safe location.

Tip:

You can also search your computer using File Explorer by entering .txt in the search box and sorting the results by Date Modified.

Method 2: Recover TXT Files with File Recovery Software

If manual methods don’t locate your file, the data may still exist on the storage device until it’s overwritten. A professional recovery tool like 4DDiG Data Recovery can scan the drive and restore deleted TXT documents.

It supports recovery from hard drives, SSDs, USB flash drives, SD cards, external disks, and formatted partitions. Besides TXT files, it can recover Word documents, Excel files, PDFs, photos, videos, archives, and thousands of other file types.

Key Features

  • Restore TXT files files after formatting, partition loss, or system crashes
  • Recover from HDDs, SSDs, USB drives, SD cards, and external devices
  • Deep Scan for difficult-to-find files
  • Preview recoverable files before saving them
  • Install and launch 4DDiG, then select the drive where the TXT file was originally stored, and 4DDiG will scan it.

    launch 4ddig and enter interface
  • Use the "Document filter" or search for ".txt" to locate the file more quickly after the scan is complete.

    click type to see all files 4ddig
  • Preview the recoverable TXT files and click "Recover" for the files you want to recover.

    preview and recover the files
  • Save them to a different location by clicking "Save Now".

    save the recoverable files

Common Problems When Creating a TXT File

Although creating a TXT file is simple, a few common issues may prevent it from working as expected.

1. TXT File Is Saved as .txt.txt

Sometimes Windows hides known file extensions. As a result, users may accidentally type ".txt" after an existing hidden extension, creating filenames like Notes.txt.

Reasons:

  • File extensions are hidden in File Explorer.
  • The filename already includes a TXT extension.

Solutions:

  • Open File Explorer.

  • Click View > Show > File name extensions (Windows 11) or enable File name extensions from the View tab in Windows 10.

  • Rename the file correctly if necessary.

2. TXT File Has Wrong Encoding

A TXT file may display strange symbols or unreadable characters if it was saved using the wrong text encoding.

Reasons:

  • Different applications use different encoding standards.
  • The file was saved using ANSI instead of UTF-8 (or vice versa).

Solutions:

  • Open the file in Notepad.

  • Select File > Save As and choose UTF-8 under Encoding.

  • Save the document again.

UTF-8 is generally the best choice because it supports multiple languages and special characters.

3. Cannot Open or Edit a TXT File

Occasionally, a TXT file won’t open or becomes inaccessible.

Reasons:

  • The file is corrupted.
  • File permissions have changed.
  • Another application is blocking access.
  • The file extension was accidentally modified.

Solutions:

  • Try opening it with another text editor such as Notepad or Notepad++.

  • Check the file’s Properties to verify permissions.

  • Restore the file from a backup if available.

  • If the file has been deleted or corrupted, use a recovery tool like 4DDiG Windows Data Recovery.

Conclusion

Creating a TXT file is useful for everything from taking notes to editing configuration files and writing code. Whether you choose Notepad, Command Prompt, TextEdit, Apple Notes, or Microsoft Word, creating a plain text document only takes a few simple steps.

If your TXT files are accidentally deleted or become inaccessible, don’t panic; 4DDiG can help recover lost TXT documents quickly and safely from a wide range of storage devices.

FREE DOWNLOAD

Secure Download

FREE DOWNLOAD

Secure Download

William Bollson (senior editor)

William Bollson, the editor-in-chief of 4DDiG, devotes to providing the best solutions for Windows and Mac related issues, including data recovery, repair, error fixes.

(Click to rate this post)

You rated 4.5 ( participated)