.cfg

How to Open CFG File: Read, Edit and Fix Configuration Files

A CFG file is a configuration file, almost always plain text, so you open it with a text editor: Notepad on Windows, TextEdit on Mac, or a code editor such as VS Code. What's inside depends on the program, whether game settings like autoexec.cfg, a Linux bootloader menu like grub.cfg, or a server's settings. The free viewer below lets you open CFG files in your browser, detects the format, highlights it and points out errors, without uploading anything.

Category: Configuration Format: Depends on the program (usually text) Opens with: Notepad, TextEdit, VS Code

Choose what you need

Open CFG File Online: Detect the Format & Check for Errors (Free)

Drop a .cfg file below or paste its text. The viewer identifies which kind of configuration it is (INI-style, key=value, game console commands, JSON, XML, YAML or block syntax), shows it with colors and line numbers, recognizes well-known files such as autoexec.cfg, config.cfg and grub.cfg, and points out problems like unbalanced quotes or braces and duplicate keys.

Good to know: the viewer only reads the file; it never changes the original. Edit the real file in a text editor after checking it here.

πŸ”’ Nothing is uploaded β€” your file never leaves this device
Or paste the text instead

What is a CFG file?

A CFG file is a configuration file that stores settings for a program, game, device or operating system component. Unlike most extensions, .cfg doesn't define one format: each program writes its own syntax. Most are readable text using one of a few common styles, and a few programs use their own binary format.

StyleLooks likeTypical examples
Console commandsbind "w" "+forward"autoexec.cfg, config.cfg in Valve/Source games
INI-style[Video] / width=1920Many Windows apps and games
Key = valuemax_connections = 100Servers, tools, Raspberry Pi-style configs
Block syntaxmenuentry "Linux" { … }grub.cfg, some server configs
JSON / XML{"volume": 80}Newer apps and emulators
BinaryUnreadable symbolsSome games and devices; only the program reads them

How to open a CFG file: quick answer

  1. Find out which program uses it: the folder it's in and the file name usually tell you (the viewer recognizes common ones).
  2. Open it in a text editor: right-click > Open with > Notepad (Windows), TextEdit (Mac, Format > Make Plain Text) or VS Code / Notepad++.
  3. If it shows gibberish, it's a binary config: don't edit it; change the settings inside the program instead.

Edit a CFG file safely

  1. Close the program or game (many rewrite their config on exit).
  2. Copy the file as a backup (config.cfg.bak).
  3. Edit in a plain-text editor; keep quotes, braces and the original encoding.
  4. Save, then restart the program; for system files use administrator / sudo rights.
  5. If something breaks, restore the backup.
Illustration: a game console config: one command or setting per line, comments start with //.

Game configuration files (autoexec.cfg, config.cfg)

In Valve's Source and Source 2 games, such as Counter-Strike 2, config.cfg stores the settings the game saves itself, and autoexec.cfg holds your own commands that run at startup. Each line is a console command: bind assigns keys, other lines set values.

  • Put personal tweaks in autoexec.cfg, not config.cfg, which the game can overwrite.
  • For Counter-Strike 2 the cfg folder is inside the game's install folder (…\game\csgo\cfg); you can make the file run with the Steam launch option +exec autoexec.cfg.
  • One missing quote can stop the rest of the file from running; the viewer flags unbalanced quotes per line.

grub.cfg and other system files

grub.cfg is the boot menu of the GRUB bootloader on Linux. On most distributions it's generated automatically and starts with a "DO NOT EDIT THIS FILE" warning: make changes in /etc/default/grub (or /etc/grub.d/) and run sudo update-grub (Debian/Ubuntu) or grub2-mkconfig -o … (Fedora and others) instead. A mistake here can stop the computer from booting, so keep a backup and a live USB at hand.

Network devices, printers, servers and emulators also use .cfg files; their documentation lists the valid settings. When in doubt, change settings through the program's own menus.

CFG problems and fixes

The file looks like gibberish

It's a binary configuration only its program can read, or the text uses UTF-16 and your editor guessed wrong. The viewer detects both.

Changes are ignored

The program overwrote the file on exit, you edited a different copy than the one it reads (check user folders such as %APPDATA% or ~/.config), or the program needs a restart.

"Access denied" when saving

Run your editor as administrator (Windows) or use sudo (Linux, macOS) for files in protected folders.

Program won't start after editing

Restore your backup, or rename the CFG so the program recreates defaults.

Sources and technical references

Frequently asked questions

How do I open a CFG file?

Most CFG files are plain text: right-click and open them with Notepad on Windows, TextEdit on a Mac or a code editor such as VS Code. The viewer on this page shows the file in your browser, identifies its format and points out errors.

What program opens CFG files?

Any text editor can open text-based CFG files: Notepad, Notepad++, TextEdit, BBEdit or VS Code. The program that created the file is what actually uses it. A few CFG files are binary and can only be read by their own program.

How do I edit a CFG file safely?

Close the program, copy the file as a backup, edit it in a plain-text editor keeping quotes and braces intact, save it and restart the program. Use administrator or sudo rights for system files, and restore the backup if anything breaks.

What is autoexec.cfg?

In Valve Source and Source 2 games such as Counter-Strike 2, autoexec.cfg is a text file of console commands that runs when the game starts. Put your own key bindings and settings there instead of config.cfg, which the game manages itself.

Can I edit grub.cfg?

Usually you shouldn't edit it directly, because it's regenerated automatically. Change /etc/default/grub or files in /etc/grub.d, then run sudo update-grub on Debian or Ubuntu, or grub2-mkconfig on other distributions.

Why does my CFG file look like gibberish?

Either the program saves its settings in a binary format only it can read, or the text is UTF-16 and your editor chose the wrong encoding. The viewer on this page detects both cases and shows readable text when possible.

Why are my CFG changes ignored?

The program may have overwritten the file when it closed, you edited a different copy than the one it reads, or it needs a restart. For games, put changes in autoexec.cfg and make sure it's executed, for example with a launch option.

Is it safe to delete a CFG file?

Usually the program recreates a default configuration, but you lose your settings. Don't delete system files such as grub.cfg. Rename the file instead of deleting it, so you can restore it if needed.

Can I open CFG files on my phone?

Yes, to read them: use the viewer on this page in your mobile browser or a text-editor app. Editing system or game files is easier and safer on a computer.

What's the difference between CFG and INI?

INI is one specific style with [sections] and key=value lines. CFG is a general extension that programs use for many styles, including INI-like files, console commands, JSON or block syntax.

Last updated .