How to Change a TXT File to CFG in Windows 11

To change a TXT file to a CFG file in Windows 11, turn on file name extensions in File Explorer (View > Show > File name extensions), right-click the file, choose Rename, replace .txt with .cfg, and confirm the warning. If you’re creating the file from scratch, you can also save it straight from Notepad as a .cfg file. Both methods are below, along with the mistakes that most often stop a game or program from reading the new file.

What a CFG file is

A .cfg file is a configuration file: plain text with settings that a program or game reads when it starts. Because it’s just text, changing the extension from .txt to .cfg doesn’t convert anything. It only tells Windows and the program that the file is a config file.

Method 1: Rename the file in File Explorer

  1. Open File Explorer (press Windows + E).
  2. Select View > Show and make sure File name extensions is checked. Without this, you’d end up with a file named settings.cfg.txt.
  3. Go to the folder that contains your text file.
  4. Right-click the file and select Rename (the icon that looks like a text cursor), or select the file and press F2.
  5. Change .txt at the end of the name to .cfg and press Enter.
  6. When Windows warns that the file might become unusable, select Yes.

The icon may change to a blank page, because Windows doesn’t have a default app for .cfg files. That’s normal.

Method 2: Save a new CFG file from Notepad

  1. Open Notepad and type or paste your settings.
  2. Select File > Save as.
  3. Set Save as type to All files (*.*).
  4. Type the file name with the extension, such as autoexec.cfg. Wrapping the name in quotation marks also stops Notepad from adding .txt.
  5. Check the Encoding option. UTF-8 works for most programs; use a different encoding only if the program’s documentation asks for it.
  6. Select Save.

Method 3: Rename with Terminal

To rename one file, open the folder in File Explorer, right-click an empty area, choose Open in Terminal, and run:

Rename-Item settings.txt settings.cfg

To change every .txt file in the folder at once in Command Prompt, run ren *.txt *.cfg. Make a copy of the folder first, because this renames all text files there.

Edit a CFG file later

Right-click the .cfg file and choose Open with > Notepad. To skip this step each time, select Choose another app, pick Notepad (or a code editor), and choose Always. Save your changes with Ctrl + S; Notepad keeps the .cfg extension.

Troubleshooting

  • The file is named settings.cfg.txt: extensions were hidden when you renamed it. Turn on File name extensions and delete the extra .txt.
  • The game or program ignores the file: check that it’s in the exact folder the program expects and that the file name matches its documentation, including capitalization on case-sensitive tools.
  • You can’t rename the file: it may be in a protected folder like Program Files, or open in another app. Close the program, or copy the file to your Documents folder, rename it, and copy it back with administrator permission.
  • Strange characters at the start of the file: some older programs can’t read a byte-order mark. Re-save the file in Notepad using plain UTF-8 or ANSI encoding.

Related guides

Frequently asked questions

Is it safe to change .txt to .cfg?

Yes. The contents don’t change, and you can rename it back at any time.

Can I open a CFG file without special software?

Yes. Any text editor, including Notepad, can open and edit it.