How to Create a File Without an Extension in Notepad
In this article
Creating a file without an extension using Notepad is a simple way to make configuration files, scripts, or plain-text files that don't have a suffix like .txt or .html. This guide walks you through the exact steps in Windows, including how to avoid the common pitfall where Windows silently adds .txt to your filename. You'll need a Windows PC with Notepad (built-in) and File Explorer. No additional software is required.
What You'll Need
- A Windows computer with Notepad installed (comes with all versions of Windows).
- Access to File Explorer (the folder window).
- Basic familiarity with right-clicking and typing a filename.
Step-by-Step
- Open Notepad. Click the Start menu, type "Notepad" in the search box, and press Enter. Or press the Windows key + R, type "notepad" and click OK.
- Type your content. Enter the text or code you want in the file. For example, if you're making a configuration file, type the settings you need.
- Open the Save As dialog. Click "File" in the top-left menu, then select "Save As..." (or press Ctrl+Shift+S).
- Choose the destination folder. In the Save As window, navigate to the folder where you want the file to live. You can use the left sidebar or the address bar at the top.
- Change the "Save as type" dropdown. At the bottom of the Save As window, next to "Save as type", click the dropdown and select "All Files (*.*)". This is critical—if you leave it as "Text Documents (*.txt)", Notepad will append .txt to your filename.
- Type the filename with no extension. In the "File name" field, type exactly what you want the file to be called, without any dot. For example:
myconfigorREADME. Do not add a period at the end. - Click "Save". The file will be saved with no extension. You can verify by looking at the file in File Explorer—it should show just the name without any suffix.
Common Mistakes
- Forgetting to change "Save as type" to "All Files". If you skip this, Notepad adds .txt automatically. For example, typing "myconfig" results in "myconfig.txt".
- Adding a period at the end of the filename. Typing "myconfig." might create a file with a trailing dot, which Windows may strip or treat oddly. Just type the name without any dot.
- Using a filename that already exists. If a file with the same name already exists, Windows will ask if you want to replace it. Make sure you're not overwriting something important.
- Not noticing the hidden file extension setting. If your Windows settings hide known file extensions, you might not see the .txt that was added, leading to confusion. You can check by right-clicking the file and selecting "Properties"—the "Type of file" will show "Text Document" if it has .txt.
Tips
- Use quotes in the filename field (alternative method). If you forget to change the "Save as type" dropdown, you can type the filename in quotes, like
"myconfig". Windows will save it exactly as written without adding an extension. This works because quotes tell Windows to ignore the automatic extension. - Create the file first, then rename. If you already have a .txt file, you can rename it in File Explorer. Right-click the file, select "Rename", delete the .txt part, and press Enter. Windows will warn you that the file might become unusable—click "Yes" to confirm. This is often faster than using Notepad's Save As.
- Use a keyboard shortcut for Save As. Press Ctrl+Shift+S in Notepad to jump straight to the Save As dialog, saving a couple of clicks.
- Check the file type after saving. In File Explorer, right-click the new file and choose "Properties". The "Type of file" should say "File" (or "TXT File" if you accidentally added an extension). This confirms you did it correctly.
Troubleshooting
The file still has .txt at the end. This means you didn't change the "Save as type" to "All Files" or you didn't use quotes. Go back to Notepad, open the file (or re-save), and follow the steps again, making sure the dropdown says "All Files (*.*)".
Windows says the file might be unusable when renaming. That's normal. When you remove an extension, Windows shows a warning because it doesn't know what program to open the file with. Click "Yes" to proceed. The file is fine—you just need to open it manually with Notepad or another program.
You can't see the extension to delete it. If your File Explorer hides known file extensions, you won't see the .txt. To show them, open File Explorer, click the "View" tab, and check the box "File name extensions". Then you can rename the file and remove the .txt.
The file saves with a different name than you typed. This can happen if you accidentally left the "Save as type" as "Text Documents"—Notepad adds .txt. Or if you typed a name with characters that Windows doesn't allow (like / \ : * ? " < > |). Use only letters, numbers, spaces, and safe symbols like underscore or hyphen.
You can't open the file after saving. Double-clicking a file with no extension may prompt you to choose a program. Select Notepad (or any text editor) and check "Always use this app" if you want it to open automatically. Alternatively, right-click → "Open with" → "Notepad".
Frequently Asked Questions
Why does Notepad always add .txt?
By default, Notepad's "Save as type" is set to "Text Documents (*.txt)". When this is active, Notepad appends .txt to any filename you type. Changing the dropdown to "All Files" stops this behavior.
Can I create a file with no extension using a different program?
Yes. Any text editor (like Visual Studio Code, Sublime Text, or even WordPad) can do it if you set the "Save as type" to "All Files" or type the filename in quotes. The steps are similar to Notepad.
What are extensionless files used for?
Common uses include configuration files (like .gitconfig, .env, or hosts), scripts that don't need an extension (like a Python script run with a shebang), or simple text files where you don't want a suffix. Many Unix-like systems use extensionless files for executables or dotfiles.
Is it safe to delete the extension from an existing file?
Yes, but Windows will lose the association with the program that normally opens it. For example, removing .txt from a text file means double-clicking won't open Notepad automatically. The file content is unchanged—you just have to open it manually.
Can I create an extensionless file in Command Prompt?
Yes. Use the command type nul > filename to create an empty file, or echo content > filename to create one with text. For example, echo hello > myconfig creates a file named "myconfig" with no extension.
Why does Windows hide extensions by default?
Microsoft hides known file extensions to reduce clutter and prevent users from accidentally changing them. This can be confusing when creating extensionless files, which is why it's helpful to enable "File name extensions" in File Explorer's View tab.