In this paper, we propose a finite element formulation for solving coupled mechanical/diffusion problems. In particular, we study hydrogen diffusion in metals and its impact on their mechanical behaviour (i.e. hydrogen embrittlement). The formulation can be used to model hydrogen diffusion through a material and its accumulation within different microstructural features of the material (dislocations, precipitates, interfaces, etc.). Further, the effect of hydrogen on the plastic response and cohesive strength of different interfaces can be incorporated. The formulation adopts a standard Galerkin method in the discretisation of both the diffusion and mechanical equilibrium equations. Thus, a displacement-based finite element formulation with chemical potential as an additional degree of freedom, rather than the concentration, is employed. Consequently, the diffusion equation can be expressed fundamentally in terms of the gradient in chemical potential, which reduces the continuity requirements on the shape functions to zero degree, {mathcal {C}}_{0}, i.e. linear functions, compared to the {mathcal {C}}_{1} continuity condition required when concentration is adopted. Additionally, a consistent interface element formulation can be achieved due to the continuity of the chemical potential across the interface—concentration can be discontinuous at an interface which can lead to numerical problems. As a result, the coding of the FE equations is more straightforward. The details of the physical problem, the finite element formulation and constitutive models are initially discussed. Numerical results for various example problems are then presented, in which the efficiency and accuracy of the proposed formulation are explored and a comparison with the concentration-based formulations is presented.