Perceiving substrate vibrations is a fundamental component of somatosensation. In mammals, action potentials fired by rapidly adapting mechanosensitive afferents are known to reliably time lock to the cycles of a vibration. This stands in contrast to coding in the higher-order somatosensory cortices, where neurons generally encode vibrations in their firing rates, which are tuned to a preferred vibration frequency. How and where along the ascending neuraxis is the peripheral afferent temporal code of cyclically entrained action potentials transformed into a rate code is currently not clear. To answer this question, we probed the encoding of vibrotactile stimuli with electrophysiological recordings along all stages of the ascending somatosensory pathway in mice. Recordings from individual primary sensory neurons in lightly anesthetized mice revealed that rapidly adapting mechanosensitive afferents innervating Pacinian corpuscles display phase-locked spiking for vibrations up to 2000 Hz. This precise temporal code was reliably preserved through the brainstem dorsal column nuclei. The main transformation step was identified at the level of the thalamus, where we observed a significant loss of phase-locked spike timing information accompanied by a further narrowing of the width of the tuning curves. Using optogenetic manipulation of thalamic inhibitory circuits, we found that parvalbumin-positive interneurons in thalamic reticular nucleus participate in sharpening the frequency selectivity and disrupting the precise spike timing of ascending neural signals encoding vibrotactile stimuli. To test the functional implications of these different neural coding mechanisms, we applied frequency-specific microstimulation within the brainstem and demonstrated that they can drive the frequency selectivity in the somatosensory cortex reminiscent of the actual response to vibration, whereas microstimulation within thalamus cannot. Finally, we applied microstimulation in the brainstem of behaving mice and demonstrated that frequency-specific stimulation could provide informative and robust signals for learning. Taken together, these findings not only reveal novel features of the computational circuits underlying vibrotactile sensation, but they might guide the development of improved biomimetic stimulus strategies to artificially activate specific nuclei along the ascending somatosensory pathway for sensory neural prostheses.