File Extension File Extension Guide

What is a CFG File?Configuration File

A technical reference for the .cfg extension that programs use to store their settings. What a CFG file holds, why it looks different in every app, how to open one and how to edit it safely without breaking the software that reads it.

Settings File 📄 Usually Plain Text ⚙️ Program Config 🎮 Common in Games
.CFG

Configuration File

Type:Settings file
Extension:.cfg
Format:Usually plain text
Standard:App-defined
Edited in:Text editor

📖 What is a CFG File?

A CFG file is a configuration file that a program uses to store its settings. The name is short for configuration, and it uses the .cfg extension. Instead of holding a document or a picture, it holds the choices that tell an application or a game how to behave, such as screen options, key bindings, file paths or performance values. When the program starts, it reads its CFG file and sets itself up accordingly.

The important thing to understand about CFG files is that they follow no single standard. The .cfg extension is generic, so each program decides its own layout. Most are plain text with one setting per line, often written as a name and a value. Others use an INI, XML or JSON structure, and a few are binary. This is why a CFG file from one program can look nothing like a CFG file from another.

You usually meet a CFG file when you want to change a setting that a program does not expose in its menus. Games are the common case, where players edit a config.cfg to adjust controls or graphics beyond the in-game options. Because the file drives how the software runs, editing it gives control but also carries a risk if you change the wrong thing.

One extension, many possible formats inside .cfgno standard name = value INI layout JSON or XML binary data Each program decides its own structure, so look inside before you assume

⚡ Quick Facts

Full nameConfiguration file
Extension.cfg
File typeSettings file, usually plain text
Common formatName and value pairs, one per line
Other formatsINI, XML, JSON or binary
Standard layoutNone, defined by each program
Common nameconfig.cfg
Opens inAny text editor
Used byApplications, games and systems
EditableYes, with care

🔤 What a CFG File Looks Like Inside

A typical plain-text CFG file lists settings as a name and a value, one per line. A line starting with a hash or a semicolon is usually a comment that the program ignores. This is a simple example.

# display settings resolution_width = 1920 resolution_height = 1080 fullscreen = true # controls mouse_sensitivity = 2.5 invert_y = false

The exact style depends entirely on the program. Some use an equals sign, some use a colon or a space, and some group settings under headings. Because there is no shared rule, the safest guide to a specific CFG file is the documentation for the program that created it.

💻 How to Open a CFG File

Since most CFG files are plain text, any text editor opens one. The choice of editor mostly affects how easy the file is to read.

Built-in editors

On Windows, Notepad opens a CFG file directly, and on a Mac, TextEdit does the same. Right-click the file, choose Open With, and pick the editor. These are fine for a quick look or a small change. If you use a word processor, save the file back as plain text so it does not add formatting that breaks the config.

Code editors

Notepad++, Visual Studio Code and Sublime Text are better for anything more than a glance. They colour the text, line up the values and highlight the structure, which makes a long CFG file far easier to read and reduces the chance of a mistake. They are free and a good default for editing config files.

✏️ How to Edit a CFG File Safely

Back up before you change anything

Editing a CFG changes how the program runs, and a wrong value can stop it working or make a game misbehave. Always copy the file first, so you can put the original back if something breaks.

1

Copy the original

Make a backup of the CFG file before touching it. If an edit goes wrong, deleting your version and restoring the copy returns the program to how it was.

2

Change one thing

Edit a single setting at a time and keep the existing format, such as the equals sign or the spacing. Do not remove lines you do not understand, since the program may need them.

3

Save and test

Save the file as plain text with the same .cfg name, then start the program to check the result. Some programs rewrite their CFG on launch, so confirm the change stuck.

Only change values you understand, and check the program's documentation or community guides for what each setting does. This is how players safely tweak game performance and controls without breaking the game.

Watch out for the hidden .txt trap

If Windows hides file extensions, saving a config in Notepad can secretly create config.cfg.txt instead of config.cfg, and the program will not find it. Turn on file extensions in the folder's View settings to check the real name, and rename it back to end in .cfg if needed.

📂 Where CFG Files Are Stored

A CFG file lives wherever the program that made it keeps its settings, and there is no single place. Knowing the usual spots saves a lot of searching.

In the program folder

Many apps and games keep a CFG in their own install folder, often in a subfolder named cfg or config. For a Steam game this is usually under steamapps and the game's own folder.

In a user or app-data folder

Others store settings per user, in a hidden application data folder tied to your account, so each person on the computer keeps their own config. Some games moved here so several users can have separate settings.

If you cannot find the file, the quickest route is the program itself. Many apps have a menu option that opens their settings folder, and Steam can open a game's local files directly, which drops you where the CFG lives.

⚔️ CFG vs INI

CFG and INI files are close relatives, both plain-text settings files, and the two extensions are often used for the same job. The difference is how strict the format is.

AspectCFGINI
FormatGeneric, defined by each programA recognised layout of sections and keys
StructureVaries widely, may be text or binarySection headers with name and value pairs
PredictabilityDepends on the applicationMore consistent across programs
EditingAny text editor, with careAny text editor

In practice, many CFG files are effectively INI files under a different extension, and both open the same way. The key point is that CFG has no guaranteed structure, so you should not assume its layout until you look inside.

🔒 When a CFG File Is Not Text

Not every CFG file is readable text. Some programs, often games and graphics tools, save their settings in a binary format to load them faster and to stop users editing them by hand.

You can tell you have hit one when a text editor shows a jumble of strange symbols and unreadable characters instead of tidy lines of settings. That is the editor trying to display data that was never meant to be read as text. In this case, editing by hand is not an option. The right way to change those settings is through the program's own options screen, which writes the file correctly. A hex editor can show the raw contents if you only need to inspect them.

🔀 Related Configuration Extensions

CFG is one of several extensions programs use for settings. They all store configuration, and the extension is often just a label the developer chose.

.iniA common settings format with a defined layout of sections and name and value pairs, close to many CFG files.
.configAnother generic configuration extension, used the same way as CFG by many programs.
.confA configuration extension common on Linux and server software for service and system settings.
.jsonA structured settings format some modern apps use, easy to read and check for errors.
.xmlA tag-based format some programs use for more complex configuration with nested settings.

❓ Frequently Asked Questions

Most CFG files are plain text, so any text editor opens one. On Windows use Notepad, and on a Mac use TextEdit, by right-clicking the file and choosing Open With. For anything longer than a quick look, a code editor such as Notepad++ or Visual Studio Code is easier, because it colours the text and lines up the settings. If the file shows strange symbols instead of readable lines, it is a binary CFG that is not meant to be edited by hand.

CFG is short for configuration. A CFG file stores the settings a program uses to decide how it behaves. The extension is generic, so many different applications and games use it for their own settings, and the file is often named config.cfg.

It is safe if you are careful. Editing a CFG changes how the program runs, so a wrong value can stop it working or make a game misbehave. Always make a backup copy first, change one setting at a time, keep the existing format, and only change values you understand. If something breaks, restoring the backup returns the program to normal.

Because it is a binary CFG file, not a text one. Some programs save settings in a binary format for speed or to stop hand editing, and a text editor cannot display that, so it shows random characters and symbols. Do not try to edit it as text. Change those settings through the program's own options screen instead, which writes the file correctly.

Both are plain-text settings files, and they are often used for the same purpose. The difference is that INI follows a recognised layout of sections and name and value pairs, while CFG has no fixed standard and its structure is whatever the program decided. Many CFG files are effectively INI files under a different name, and both open in any text editor.

Often yes, but back it up first. Many programs recreate a missing CFG with default settings the next time they start, which is a way to reset a program whose settings have become broken. Some programs need the file and will not run properly without it, so move a copy aside rather than deleting outright, and you can always put it back.

Games use CFG files to store settings such as graphics, controls and key bindings, and they let players change options the in-game menu does not offer. This is why gaming communities share config files, such as an autoexec.cfg that runs a set of commands each time a game starts, to copy a professional player's setup or to squeeze out better performance. Editing one is a common way to customise a game, as long as you back up the original first.

No. Renaming a plain-text CFG file to .txt does not change its contents, only its label, so you can still open it in any text editor. To let the program read it again, rename it back to .cfg. Renaming does nothing to a binary CFG either, though that still cannot be edited as text.

There is no single place, since each program stores its CFG where it keeps its settings. Common spots are the program's own install folder, often in a subfolder named cfg or config, or a per-user application data folder tied to your account. For a game on Steam, browse to the local files through the game's menu, which opens the folder where its config lives. If a program has a menu option to open its settings folder, that is the fastest way to find it.

The usual cause is that the file was saved with the wrong name. When Windows hides file extensions, Notepad can save config.cfg as config.cfg.txt without you noticing, and the program cannot find it. Turn on file extensions in the folder's View settings, check the real name and rename it to end in .cfg. Other causes are a syntax slip such as a missing bracket, or a program that rewrites its config on startup and overwrites your change.

📝 Summary

A CFG file is a configuration file that stores a program's settings, saved with the .cfg extension. It is usually plain text with one setting per line, though the format is generic and varies from program to program, and a few are binary. Open one in any text editor such as Notepad or the free Notepad++, and edit it with care, always backing up the original first, since a wrong value can stop the program working. Games are the most common place people edit CFG files, to change controls and graphics beyond the in-game menus.