What is a .cfg file?
Configuration File · Code and data · Various · n/a
A .cfg file is a generic configuration file. Like .conf, it is a label many programs use for their settings, so the exact format depends on the software that created it, though most are readable text.
What is a .cfg file used for?
There is no single .cfg standard. Games, applications and tools each define their own layout, commonly key=value lines or sections in brackets, similar to INI. Most are plain text you can open and tweak.
Because a .cfg belongs to a specific program, editing one by hand only helps if you know that program's settings. A wrong value can stop the software loading, so keep a backup before changing it.
How to open a .cfg file
The .cfg format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .cfg file.
Windows
- Notepad++
- VS Code
- any text editor
macOS
- VS Code
- TextEdit
- any text editor
Linux
- nano
- VS Code
- any text editor
.cfg file signature (magic bytes)
Programs recognise a .cfg file by the bytes at the start of the file, not by its name. These are the signatures for CFG.
| Hex signature | Offset | Note |
|---|---|---|
| (no fixed signature) | 0 | plain text; no fixed magic bytes |
See the full magic-numbers reference for every format.
Frequently asked questions
What is a .cfg file?
A .cfg file is a generic configuration file. Like .conf, it is a label many programs use for their settings, so the exact format depends on the software that created it, though most are readable text.
How do I open a .cfg file?
Open it in a text editor like VS Code or Notepad++. Most .cfg files are readable text, even though the exact layout depends on the program.
Can I edit a .cfg file?
Often yes, but only if you know the program's settings. Back up the original first, since a bad value can stop the software from starting.
Why is my .cfg file unreadable?
Some programs store .cfg data in a binary form. If it looks like gibberish in a text editor, only the program that made it can read it.
Related formats
Sources
Details on this page were checked against authoritative references: