The accurate calibration of the force constant of the probe in atomic force microscopy and optical tweezers applications is extremely important for force spectroscopy. The commonly used silicon detectors exhibit a complex transfer function for wavelengths >850 nm, which limits the detection bandwidth leading to serious errors in the force constant determination. We show that this low-pass effect can be compensated for using the frequency response of the detector. This is applicable for calibrations in both atomic force microscopy and optical tweezers. For optical tweezers an additional correction method is discussed based on fitting an expression in which the low-pass characteristics are already accounted for.