Here, we introduce a numerical approach for a class of Fokker-Planck (FP) equations. These equations are the adjoint of the linearization of Hamilton-Jacobi (HJ) equations. Using this structure, we show how to transfer properties of schemes for HJ equations to FP equations. Hence, we get numerical schemes with desirable features such as positivity and mass-preservation. We illustrate this approach in examples that include mean-field games and a crowd motion model.