Windows 11 shows file extensions by default, but you can hide them for all files or remove the .txt extension from individual files

File extensions like .txt tell Windows what program should open a file. By default, Windows 11 displays these extensions in File Explorer. If you want to hide extensions across your entire system, you can turn off the setting in File Explorer options. If you want to remove the .txt extension from a single file, you rename the file directly — but understand that removing the extension does not change what the file actually is, and Windows may stop recognizing which program should open it.

The method you choose depends on whether you want to hide extensions from view (they still exist) or actually change a filename. Most people who ask this question want to hide extensions, not remove them.

Key Takeaways

  • Hiding file extensions in File Explorer is a display setting that does not change the files themselves — the extensions still exist.
  • To hide extensions for all files, open File Explorer, click the View tab, then uncheck "File name extensions" in the Show/hide group.
  • To rename a single file and remove its .txt extension, right-click the file, select Rename, delete the .txt part, and press Enter.
  • Removing an extension from a filename can prevent Windows from opening the file with the correct program, so only do this if you have a specific reason.
  • You can always add the extension back by renaming the file again if you change your mind.

Hide file extensions for all files at once

Open File Explorer by pressing the Windows key and typing "file explorer," then click the result. In the top menu bar, click the View tab. On the right side of the ribbon, look for the Show/hide group. You will see a checkbox next to "File name extensions" — uncheck it. All file extensions will immediately disappear from the display in File Explorer.

This setting applies to every folder and every file type on your computer. If you change your mind, return to the same location and check the box again. The extensions are still there; you are only hiding them from view. Windows still knows what program should open each file.

Rename a single file to remove the .txt extension

Right-click the .txt file you want to rename. Select Rename from the menu. The filename will become editable. Delete the ".txt" part at the end, leaving only the name you want. Press Enter to confirm the change.

For example, if the file is named "notes.txt", you would delete the ".txt" so it reads "notes" instead. Windows will ask you to confirm that you want to remove the extension — click Yes. The file will now display without the .txt extension in File Explorer.

Be aware that removing the extension changes how Windows recognizes the file. When you double-click it, Windows may not know which program should open it, or it may open in the wrong program. You can always rename it again and add ".txt" back if this happens.

Why you might want to hide rather than remove extensions

Hiding extensions keeps your files organized and lets Windows continue to recognize them correctly. Removing the extension from the filename itself can cause problems — the file may not open when you double-click it, or it may open in an unexpected program.

Most people who want a cleaner look in File Explorer choose to hide extensions instead of removing them. This gives you the visual result you want without breaking the file's connection to its program. If you need to work with the file later, everything continues to work as expected.

What happens when you remove a file extension

A file extension is metadata that tells Windows which program should handle the file. The .txt extension means "this is a text file — open it with Notepad or another text editor." When you remove the extension from the filename, you are not changing what the file contains; you are only changing the label Windows uses to identify it.

If you remove the .txt extension, Windows may display a generic file icon instead of a text document icon. When you try to open the file by double-clicking, Windows will either ask you which program to use, or it will guess and potentially open it in the wrong program. The file itself is unchanged — you can always add the extension back.

Restore a file extension if you removed it by mistake

Right-click the file that is missing its extension. Select Rename. Type the filename followed by ".txt" — for example, "notes.txt". Press Enter and confirm the change. The file will now display with the .txt extension again, and Windows will recognize it as a text file.

If you are not sure what extension the file should have, look for a backup copy or check with whoever gave you the file. Most text files use .txt, but some use .log, .csv, or other extensions depending on their purpose.

Frequently Asked Questions

If I hide file extensions, can I still open my files normally?

Yes. Hiding extensions only changes what you see on screen — the extensions still exist and Windows still recognizes the files. Double-clicking a file will open it in the correct program whether extensions are hidden or visible.

Will removing the .txt extension break the file?

No, the file itself is not broken. The content inside remains unchanged. However, Windows may not know which program should open it, so you might have to choose a program manually each time. You can add the extension back by renaming the file again.

Can I hide extensions for only certain file types?

No. The File Explorer setting hides or shows all extensions at once. If you want to hide extensions for only .txt files, you would need to rename each file individually, which is not practical. Hiding all extensions is the easier approach.

What if a file opens in the wrong program after I remove the extension?

Right-click the file, select "Open with," and choose the correct program from the list. If the correct program does not appear, select "Choose another app" and browse for it. To fix this permanently, rename the file and add the .txt extension back.

Do I need to hide extensions for security reasons?

No. Showing or hiding extensions does not affect security. Some people hide them for a cleaner look, while others keep them visible to see exactly what type of file they are working with. Choose whichever you prefer.