In order to accurately and efficiently model the propagation of surface gravity waves in infinitely deep domains, we introduce an infinite mapping layer which transforms the unbounded physical domain into a bounded computational domain by means of a mapping function. The method was implemented in the framework of the finite element method, where it can be straightforwardly combined with a perfectly matched layer to model unbounded domains in horizontal direction. Finally, the application of the method is demonstrated by a simple 3D example. (© 2017 Wiley‐VCH Verlag GmbH & Co. KGaA, Weinheim)