A config file stores the settings your program uses to run

A config file is a plain text document that holds the choices and preferences a program needs to work the way you want it to. Instead of hardcoding settings into the program itself, developers put them in a separate file so you can change how the program behaves without touching the code. When you start the program, it reads the config file first and applies those settings before it does anything else.

Think of it like a checklist a restaurant manager reads every morning: the hours it opens, the temperature the walk-in cooler should be, which suppliers to call. The restaurant runs the same way every day because someone wrote those decisions down in one place. A config file does the same thing for software.

Config files are almost always plain text, which means you can open them in Notepad, TextEdit, or any text editor. They are not Word documents or PDFs — just raw text with no formatting. This makes them fast to read and easy to edit by hand if you need to change something.

Key Takeaways

  • A config file is a plain text document that tells a program what settings to use when it starts up.
  • Config files let you change how a program behaves without editing the program code itself.
  • Common config file formats include .ini, .conf, .yaml, .json, and .xml, each with slightly different ways of organizing information.
  • Most programs look for their config file in a specific folder, usually in your user directory or the program's installation folder.
  • Editing a config file wrong can break a program, so always make a backup copy before you change anything.

Where config files live on your computer

The location of a config file depends on the program and your operating system. On Windows, many programs store their config files in a hidden folder called AppData inside your user directory. On Mac and Linux, config files often live in a hidden folder that starts with a dot, like .config or .ssh.

Some programs keep their config file right next to the program itself in the installation folder. Others look for it in multiple places in a specific order — first in your user directory, then in a system-wide folder, then in the program folder. The program's documentation or help file should tell you where it expects to find the config file.

If you cannot find the config file, the program may not have one yet. Some programs create a default config file the first time they run. Others let you create one yourself and place it in the right location. A few programs do not use config files at all and store settings in a database or registry instead.

Common config file formats and what they look like

Different programs use different formats for their config files. The format is just the way the information is organized and written down. Here are the ones you will see most often:

.ini files use a simple format with sections in square brackets and key-value pairs. A line might look like port=8080 or debug=true. .conf files are similar but often used for system-level programs on Linux and Mac. .yaml files use indentation to show structure, which makes them readable but requires exact spacing. .json files use curly braces and quotes and are common in web applications. .xml files use tags like HTML and are verbose but very structured.

You do not need to memorize these formats. The important thing is that they are all plain text, so you can open and read them. If you need to edit one, look at the existing format and follow the same pattern. If you get the format wrong — like forgetting a quote mark or using the wrong bracket — the program will not be able to read it and may refuse to start.

How to safely edit a config file

Before you change anything in a config file, make a backup copy. Right-click the file, select Copy, and paste it in the same folder with a name like config.backup or config.old. If something goes wrong, you can delete the broken version and rename the backup back to the original name.

Open the config file in a plain text editor. On Windows, use Notepad. On Mac, use TextEdit but make sure to set the format to plain text first — go to Format menu and select Make Plain Text. On Linux, use nano, vi, or gedit. Do not use Word or Google Docs because they add invisible formatting that will break the file.

Find the setting you want to change and edit only that line. Do not add extra spaces or change the format. Save the file with the same name and close it. Then restart the program so it reads the new config file. If the program will not start or behaves strangely, close it, delete the broken config file, and rename your backup back to the original name.

Why programs use config files instead of menus

Some settings are too technical or too rarely changed to put in a menu. A config file lets developers expose those settings to people who need them without cluttering the user interface. It also means you can set up a program exactly the way you want it before you even run it for the first time.

Config files are also useful when you need to run the same program on many computers with the same settings. Instead of clicking through menus on each machine, you copy the config file to all of them. System administrators use this approach all the time to set up software across an entire office or data center.

Some programs let you change settings both in a menu and in the config file. In those cases, the config file usually wins — if you set something in the menu and also in the config file, the config file value is what the program actually uses.

What happens if a config file is missing or broken

If a program cannot find its config file, it usually creates a new one with default settings the next time it runs. This is why some programs seem to "reset" if you delete their config file — they are just making a fresh one with factory defaults.

If the config file exists but is broken — maybe you edited it wrong or it got corrupted — the program may refuse to start, start with default settings, or crash partway through loading. The error message, if there is one, usually tells you which line of the config file has the problem.

If you break a config file and cannot fix it, the safest move is to delete it and let the program create a new default one. You will lose your custom settings, but the program will work again. Then you can slowly add back the settings you need, testing after each change.

Config files versus settings stored in menus

Most programs let you change settings through a menu or preferences window. Those settings are usually stored somewhere — in a config file, a database, or a registry. The difference is whether you edit them by hand or through the program's interface.

If a setting is in a menu, use the menu to change it. If a setting is only in a config file, you have to edit the file by hand. Some programs do not have a menu for certain settings because they are meant for advanced users or system administrators who are comfortable editing text files.

A few programs sync settings between the menu and the config file, so changing one updates the other. Others keep them separate — the menu controls one set of settings and the config file controls another. Read the program's documentation to know which is which.

Frequently Asked Questions

Can I edit a config file while the program is running?

You can edit the file, but the program will not see the changes until you close it and restart it. Some programs re-read their config file every few seconds, but most only read it once when they start. Check the program's documentation to know for sure.

What if I do not know what a setting in the config file means?

Search the program's documentation or help file for the setting name. If that does not work, search online for the program name plus the setting name. Do not guess and change settings you do not understand — you can break the program or create a security problem.

Is it safe to share a config file with someone else?

It depends on what is in it. Some config files contain passwords, API keys, or other sensitive information. Before you share one, open it and check for anything private. If it contains secrets, remove them first or tell the other person to replace them with their own.

Why is my config file hidden?

On Mac and Linux, files that start with a dot are hidden by default to keep your home directory clean. To see them, you usually have to turn on "show hidden files" in your file manager. On Windows, some config files are hidden because they are in the AppData folder, which is also hidden by default.

Can I have multiple config files for the same program?

Some programs support this, but most expect one main config file in one specific location. A few advanced programs let you specify which config file to use when you start them from the command line. Check the program's documentation or help text to see if this is an option.