Numerical inversion of Laplace transforms is a powerful tool in computational probability. It greatly enhances the applicability of stochastic models in many fields. In this article we present a simple Laplace transform inversion algorithm that can compute the desired function values for a much larger class of Laplace transforms than the ones that can be inverted with the known methods in the literature. The algorithm can invert Laplace transforms of functions with discontinuities and singularities, even if we do not know the location of these discontinuities and singularities a priori. The algorithm only needs numerical values of the Laplace transform, is extremely fast, and the results are of almost machine precision. We also present a two-dimensional variant of the Laplace transform inversion algorithm. We illustrate the accuracy and robustness of the algorithms with various numerical examples.