Viscoelastic characterization of materials at the micro- and nanoscales is commonly performed with the aid of force-distance relationships acquired using atomic force microscopy (AFM). The general strategy for existing methods is to fit the observed material behavior to specific viscoelastic models, such as generalized viscoelastic models or power-law rheology models, among others. Here we propose a new method to invert and obtain the viscoelastic properties of a material through the use of the Z-transform, without using a model. We present the rheological viscoelastic relations in their classical derivation and their Z-domain correspondence. We illustrate the proposed technique on a model experiment involving a traditional ramp-shaped force-distance AFM curve, demonstrating good agreement between the viscoelastic characteristics extracted from the simulated experiment and the theoretical expectations. We also provide a path for calculating standard viscoelastic responses from the extracted material characteristics. The new technique based on the Z-transform is complementary to previous model-based viscoelastic analyses and can be advantageous with respect to Fourier techniques due to its generality. Additionally, it can handle the unbounded inputs traditionally used to acquire force-distance relationships in AFM, such as “ramp” functions, in which the cantilever position is displaced linearly with time for a finite period of time.