The solar chromosphere can be observed well through strong absorption lines. We infer the physical parameters of chromospheric plasmas from these lines using a multilayer spectral inversion. This is a new technique of spectral inversion. We assume that the atmosphere consists of a finite number of layers. In each layer the absorption profile is constant and the source function varies with optical depth with a constant gradient. Specifically, we consider a three-layer model of radiative transfer where the lowest layer is identified with the photosphere and the two upper layers are identified with the chromosphere. The absorption profile in the photosphere is described by a Voigt function, and the profile in the chromosphere by a Gaussian function. This three-layer model is fully specified by 13 parameters. Four parameters can be fixed to prescribed values, and one parameter can be determined from the analysis of a satellite photospheric line. The remaining 8 parameters are determined from a constrained least-squares fitting. We applied the multilayer spectral inversion to the spectral data of the H$\alpha$ and the Ca II 854.21 nm lines taken in a quiet region by the Fast Imaging Solar Spectrograph (FISS) of the Goode Solar Telescope (GST). We find that our model successfully fits most of the observed profiles and produces regular maps of the model parameters. The combination of the inferred Doppler widths of the two lines yields reasonable estimates of temperature and nonthermal speed in the chromosphere. We conclude that our multilayer inversion is useful to infer chromospheric plasma parameters on the Sun.