An algorithm for computing the multigraded Hilbert depth of a module. A method for computing the multigraded Hilbert depth of a module was presented in [B. Ichim and J.-J. Moyano-Fernández, Math. Nachr. 287, No. 11–12, 1274–1287 (2014; Zbl 1302.05212)]. In this paper, we improve the method and we introduce an effective algorithm for performing the computations. In a particular case, the algorithm may also be easily adapted for computing the Stanley depth of the module. We further present interesting examples that were found with the help of an experimental implementation of the algorithm Hdepth [B. Ichim and A. Zarojanu, “Hdepth: An Algorithm for Computing the Multigraded Hilbert Depth of a Module”, Implemented in CoCoA. Available online https://dl.dropboxusercontent.com/s/urhrasy5ntgbwzf/Hdepth.htm]. Thus, we completely solve several open problems proposed in [J. Herzog, Lect. Notes Math. 2083, 3–45 (2013; Zbl 1310.13001)].