Where is user preference file of Blender

GOAL

To find preference file of Blender and view the contents of the file.

Environment

Blender 2.83 (I’m using 2.83 because it is LTS)
Windows 10

What is saved in preference files?

There are two areas where Blender’s defaults are stored:

The Preferences file stores keymap, add-ons theme and other options.

The Startup File stores the scene, Workspaces and interface which is displayed at startup and when loading a new file (File ‣ New).

from Blender2.91 manual

Where are user preference file and startup file?

Reference: Blender’s Directory Layout

Both of the preference file and the startup file are in USER directory. In my case, windows, the USER directory was C:\Users\<USER_NAME>\AppData\Roaming\Blender Foundation\Blender\2.83.

The config directory is Blender\2.83.\config\ and you can find config directory with python API below.

bpy.utils.user_resource('CONFIG')

The preference file is config\userpref.blend. This is the .blend file with no world and object. If there is no userpref.blend, start blender and change the preference with the Edit > Preferences…

The startup file is config\startup.blend. If there is no startup.blend, you can create it with File > Defaults > Save Setup File. This is the .blend file to open when blender starts.

What are preference files for?

Save/Load preference

These files are used to save user changed preferences. You can use other preferences by putting files in config directory.

Backup

If you copy or remove there files, you can create backups.

Reset

You can reset preferences by renaming or removing there preference files.