Building on recent results for adiabatic gauge potentials, we propose a variational approach for computing the generator of Schrieffer-Wolff transformations. These transformations consist of block diagonalizing a Hamiltonian through a unitary rotation, which leads to effective dynamics in a computationally tractable reduced Hilbert space. The generator of these rotations are computed variationally and thus go beyond standard perturbative methods; the error is controlled by the locality of the variational ansatz. The method is demonstrated on two models. First, in the attractive Fermi-Hubbard model with on-site disorder, we find indications of a lack of observable many-body localization in the thermodynamic limit due to the inevitable mixture of different spinon sectors. Second, in the low-energy sector of the XY spin model with a broken U(1)-symmetry, we analyze ground state response functions by combining the variational SW transformation with the truncated spectrum approach.