What Is a .CFG File? (.cfg, .conf)
A .cfg file is a configuration file that stores settings for a program, game or device, usually as plain text. There is no single CFG format: some use key=value lines like INI, others lists of commands or JSON-like blocks. Notepad, TextEdit or VS Code open them; the owning program decides what each line means.
- Extension
- .cfg, .conf
- Full name
- Configuration File
- Type
- System and app file
About CFG files
CFG and .conf files are everywhere: Linux and server software, network gear, emulators, mods and many PC games. Source and Counter-Strike games, for example, read autoexec.cfg files in which each line is a console command such as a key binding or sensitivity setting, run when the game starts.
Because the program reads the file with its own rules, small mistakes like a missing quote, wrong capitalization or an extra space can make a setting silently ignored, or stop a server from starting. Back up the file before editing, change one thing at a time and check the program's documentation for valid options.
Some CFG files are binary rather than text, mostly from older or proprietary programs; if Notepad shows unreadable symbols, do not edit it. Configuration files can contain passwords, API keys and server addresses, so remove those before posting a config on a forum.
What CFG files are used for
- Game settings, key bindings and autoexec scripts
- Server and network device configuration
- Emulator and mod settings
- Application preferences on Linux and macOS
How to open a .cfg file
Windows
Right-click and choose Open with > Notepad, or use VS Code for syntax highlighting and search.
Mac
Open with TextEdit or VS Code. Files in hidden folders can be reached in Finder with Go > Go to Folder.
Linux
Use nano, vim or any graphical editor; system configs under /etc need sudo to save.
How to convert a .cfg file
CFG files are tied to the program that reads them, so conversion rarely makes sense. Renaming .cfg to .txt only changes which app opens it by default; rename it back or the program will not find it.
If a program supports multiple formats (for example JSON or YAML configs), rewrite the settings using its documentation rather than renaming.
Changing the extension in the file name does not convert the file. See how to change a file extension for when renaming is safe.
Naming and renaming CFG files
- Keep the exact name the program expects (autoexec.cfg, server.cfg); a different name means it will not be loaded.
- Back up before editing with a dated copy (server.cfg.2025-07-10.bak) that the program will ignore.
- For multiple setups, keep named copies (config-tournament.cfg) and load or swap them deliberately.
Renaming lots of .cfg files? Use the free online bulk renamer for patterns and numbering, or try File Renamer AI to name each file from what is inside it.
Related file types
A .ini file is a plain-text configuration file that stores settings as key=value pairs grouped under [Section] headings. Windows programs, games and many cross-platform tools use INI files for options such as resolution, paths and preferences. Any text editor, including Notepad and TextEdit, can open and edit them.
A .yaml or .yml file is a plain-text data file in YAML, a human-friendly format that uses indentation instead of brackets to structure lists and key-value pairs. It is the standard for configuration in Docker Compose, Kubernetes, GitHub Actions, Ansible and many apps. Both extensions mean exactly the same thing.
A .json file is a plain text data file in JavaScript Object Notation, a lightweight format of names, values, lists and nested objects. It is the standard way web APIs exchange data and a common format for app settings, exports and configuration. Any text editor opens JSON, and browsers can display it nicely.
A .xml file is a plain text data file in Extensible Markup Language, which stores information in nested, self-describing tags such as <invoice> and <total>. It is used for data exchange, configuration, sitemaps, RSS feeds and document formats. Any text editor or browser can open an XML file.
Frequently Asked Questions
How do I open a CFG file?
With a text editor such as Notepad, TextEdit or VS Code. If the content is unreadable, it is binary and should only be changed by its program.
Can I delete a CFG file?
Usually the program recreates defaults, but you lose your settings. Back it up first.
Is a CFG file dangerous?
It is just settings and does not run on its own, though game CFGs can run in-game console commands.