One contribution of 15 to a theme issue 'Free boundary problems and related topics' . We review the finite-element approximation of the classical obstacle problem in energy and max-norms and derive error estimates for both the solution and the free boundary. On the basis of recent regularity results, we present an optimal error analysis for the thin obstacle problem. Finally, we discuss the localization of the obstacle problem for the fractional Laplacian and prove quasi-optimal convergence rates.