Slope is one of the most basic parameters that can be derived from a DEM. It corresponds to the first derivative of the DEM, and it represents the rate of change of the elevation. It is computed by analyzing the elevation of each cell and comparing this with the elevation of the surrounding ones. This recipe shows you how to compute slope in QGIS.

Slope is calculated from a DEM elevation model by analyzing the cells around a given one. This analysis is performed by the slope algorithm from the GDAL library.
There are several ways of using the slope algorithms in QGIS. Here are some comments and ideas about this.
If the units of elevation are not the same as the horizontal units, you can convert them, as we did in the previous recipe, using the raster calculator. However, the slope module contains an option to convert them on-the-fly by entering the conversion factor in the Scale field. Note that this option is not available in other terrain analysis modules that we will use, so it's still good practice to create a layer with the correct units, which can be used without any further processing.
The Processing framework contains algorithms that rely on several external applications and libraries. These libraries sometimes contain similar algorithms, so there is more than one option for a given analysis.
If you switch the presentation mode of the toolbox from simplified to advanced using the lower part of the drop-down list and then type slope in the search box, you will see something like the following screenshot:
