Open a config file with a plain text editor: right-click it in File Explorer and select Open with > Notepad on Windows, use Open With > TextEdit on a Mac, or run nano followed by the file name on Linux.
This guide covers what config files are, the common extensions, step-by-step routes for Windows, macOS and Linux, how to edit one safely, and what to do when a config file will not open or will not save.
How to open a config file on Windows
Notepad is built into Windows and opens any plain-text config file, whatever its extension. Use this route for .ini, .cfg, .conf, .config, .json and .xml files.
- Open File Explorer and go to the folder that holds the config file.
- Right-click the file and select Open with > Choose another app.
- Select Notepad from the list of apps.
- Read or edit the file, then select File > Save to keep your changes.
To open the file from inside the editor instead, select Start, type Notepad, open it, and use File > Open. If Windows hides the extension so you cannot tell which file is the config file, you can open File Explorer and turn on View > Show > File name extensions.

What is a config file?
A config file is a text file that stores an app's settings so they can change without changing the program itself. Microsoft describes .NET Framework configuration files as XML files that let developers change settings without recompiling the app.
| What it usually contains | Example |
|---|---|
| Settings as name and value pairs | A server address, a port number, a language code |
| Paths to files or folders the app uses | Where logs or a database are stored |
| Feature switches | A line that turns a pre-login banner on in /etc/ssh/sshd_config |
| Machine-wide settings that apply to every app | .NET Framework's Machine.config, which sits in the runtime's Config folder |
| App-specific settings shipped with a program | A .NET app named myApp.exe reads myApp.exe.config |
Most config files are plain text, which is why a basic text editor opens them. A few apps keep settings in binary files that only the app itself can read.
Common config file types and extensions
The extension tells you the format, and the format tells you which editor shows it best. Config files without an extension, such as sshd_config, are still plain text.
| Extension | Format | Where you see it | Open it with |
|---|---|---|---|
| .ini | Windows initialization configuration file: sections and key=value lines | Older Windows apps and games | Notepad or any text editor |
| .config | XML | .NET Framework apps (App.config, web.config, Machine.config) | Visual Studio, VS Code or Notepad |
| .conf | Plain text, syntax set by the program | Linux services, such as snippets in /etc/ssh/sshd_config.d/ |
nano, a code editor or TextEdit |
| .cfg | Plain text, syntax set by the program | Games and cross-platform tools | Any text editor |
| .json | Structured text with braces and quoted keys | Web apps and developer tools | VS Code or another code editor |
| .xml | Tagged text; case-sensitive like all XML | Windows and .NET settings, many Java apps | VS Code, Visual Studio or Notepad |
| .yaml or .yml | Indentation-based text | Deployment and automation tools | A code editor that shows indentation |
| No extension | Usually plain text | Linux and macOS system files under /etc |
nano on Linux, TextEdit or Terminal on a Mac |
To recognize a format from the contents, look at the first lines: angle-bracket tags mean XML, braces mean JSON, and [section] headers followed by name=value lines mean INI style. On Linux, the file command reports the file type.

How to open a config file in Visual Studio Code
A code editor colors the syntax, so a missing bracket or quote stands out before it breaks the app. VS Code also shows the file's encoding and can reopen the file in a different one.
- Open Visual Studio Code.
- Use the File menu to open the config file.
- Check the file's encoding in the Status Bar at the bottom of the window.
- If characters look wrong, click the encoding button in the Status Bar, choose to reopen the file with a different encoding, and pick the correct one.
- Make your change and press Ctrl + S to save.
Notepad++ is another free source code editor for Windows that supports several programming languages, if you prefer a lighter app.

How to open a config file on macOS
TextEdit opens plain-text files, and the Finder can send any file to it even when macOS does not know the extension.
- In the Finder, select the config file.
- Choose File > Open With, or Control-click the file and choose Open With.
- Choose TextEdit.
- If the file shows formatting it should not have, choose Format > Make Plain Text before saving.
- Choose File > Save to keep your changes.
macOS usually hides filename extensions. To see them, choose Finder > Settings, click Advanced, and select Show all filename extensions.

Open a config file with Terminal on Mac
Open Terminal from Spotlight or from /Applications/Utilities. You can drag the file into the Terminal window to fill in its full path.
less /path/to/file.conf
open -a TextEdit /path/to/file.conf
less shows the file one screen at a time without changing it; press Q to quit. The open command launches an app and can open a file in it, so open -a TextEdit sends the config file to TextEdit for editing.
You should see: The file's text scrolls in the Terminal window, or a TextEdit window opens with the file loaded.
Use cat instead of less for a short file you want printed all at once.
How to open a config file on Linux
On Linux, most system config files live under /etc and belong to the root account. nano is a simple terminal editor that works one file at a time and shows its shortcuts at the bottom of the screen.
- Press Ctrl + Alt + T on Ubuntu to open a terminal, or search for Terminal in the app launcher.
- Type
less /etc/ssh/sshd_configto read a file without changing it, and press Q to quit. - Type
sudo nano /etc/ssh/sshd_configto edit a system file, and enter your password. - Press Ctrl + W to search for the setting you want to change.
- Press Ctrl + O to save, then Ctrl + X to exit nano.
Files in your home folder, such as settings for your own apps, open without sudo: type nano followed by the file name. A graphical text editor from your desktop's app menu opens the same files.
Best practices before editing a config file
- Find the config file you need: check the app's own documentation for the exact name and folder before you open anything.
- Create a backup copy first, such as
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.originalon Linux, or copy and paste the file in File Explorer or the Finder. - Use the right editor for the file type: a code editor for XML, JSON and YAML, a plain text editor for INI and CONF files, never a word processor.
- Check permissions before saving: system files need an administrator account on Windows or macOS and
sudoon Linux. - Make small, trackable changes: change one setting at a time and add a comment line where the format allows it.
- Restart the app or service so it reads the new settings.
A backup that ends in .bak or .original is just a copy with a new name. To restore one, rename it back, or open the BAK file in a text editor to compare it with your edited version.
How to test a Linux config file after editing
Many services can check their own config file before they restart, which catches a typo before it takes the service down. OpenSSH on Ubuntu is a good example.
- Save the file in nano with Ctrl + O and exit with Ctrl + X.
- Run
sudo sshd -tto test the OpenSSH server configuration. - Fix any line the command reports, then run the test again until it prints nothing.
- Run
sudo systemctl restart ssh.serviceto apply the change. - Run
sudo journalctl -fu ssh.serviceto watch the service log for errors.
Other services have their own test command, so check the service's documentation before you restart it.
Troubleshooting config files that won't open
Windows asks how you want to open the file
No app is set as the default for that extension.
- Right-click the file and select Open with > Choose another app.
- Select Notepad or your code editor.
- To make the choice permanent, open Settings > Apps > Default apps, type the extension such as .ini in the search bar, and pick the app.
Access denied or permission error when you save
The file sits in a protected system folder or belongs to another account.
- On Windows, right-click the editor in the Start menu, select More > Run as administrator, then open the file again.
- On Linux, run
ls -lfollowed by the file name to see the owner and permissions. - Edit system files on Linux with
sudo nanofollowed by the full path. - On a Mac, save a copy to your Documents folder if you do not have rights to the original location.
The file shows strange symbols or unreadable text
The editor picked the wrong text encoding, or the file is binary rather than text.
- In VS Code, click the encoding button in the Status Bar and reopen the file with a different encoding.
- In TextEdit, choose TextEdit > Settings > Open and Save and change Plain Text File Encoding.
- On Linux, run
filefollowed by the file name to check whether it is text at all. - If it is binary, change the settings from inside the app that owns the file instead.
The app ignores your changes
The app reads its settings only at startup, or another file overrides yours.
- Restart the app or service after saving.
- Check for snippet folders that load after the main file; on Ubuntu, files in
/etc/ssh/sshd_config.d/override/etc/ssh/sshd_config. - For .NET Framework apps, remember Machine.config is read before the app's own config file.
Config file FAQ
What program should I use to open a config file?
Use a plain text editor. Notepad comes with Windows, TextEdit comes with macOS, and nano runs in most Linux terminals. For XML, JSON or YAML files, a code editor such as Visual Studio Code is easier because it colors the syntax.
How do I know what type of config file I have?
Turn on file name extensions and check the ending, such as .ini, .xml or .json. If there is no extension, open the file in a text editor and look at the first lines, or run the file command on Linux to report the file type.
Is it safe to edit a config file?
Yes, if you make a backup copy first and change one setting at a time. A typo can stop an app or service from starting, so keep the original file and restore it if the app fails after your change.
Why does my computer say I do not have permission to open or save the config file?
The file sits in a protected folder or belongs to another account. Open your editor with Run as administrator on Windows, or use sudo before the editor command on Linux, then open and save the file again.
What should I do if a config file will not open or looks unreadable?
Try a different text editor, then check the encoding. VS Code and TextEdit can reopen a file with another encoding. If the text is still unreadable, the file is probably binary and must be changed from inside the app that owns it.
Can I open a .config file in Notepad?
Yes. A .config file used by .NET Framework apps is an XML text file, so Notepad opens and saves it. A code editor such as VS Code is easier to read because it colors the tags and flags unbalanced ones.
Does changing a config file's extension convert it?
No. Microsoft notes that changing a file name extension does not convert the file to another format. It only changes the name, and the app that reads the file may no longer find it, so keep the original extension.
Best text editor for config files
Use the plain text editor built into your system for quick reads, and Visual Studio Code for any config file you plan to change. Notepad, TextEdit and nano open every text-based config file with no setup, but a code editor's syntax colors and encoding controls catch the typos and character problems that most often break an app after an edit.




