We studied the physical parameters of the penumbra in a large and fully developed sunspot, one of the largest over the last two solar cycles, by using full-Stokes measurements taken at the photospheric Fe i 617.3 nm and chromospheric Ca ii 854.2 nm lines with the Interferometric Bidimensional Spectrometer. Inverting measurements with the Non-LTE inversion COde (NICOLE) code, we obtained the three-dimensional structure of the magnetic field in the penumbra from the bottom of the photosphere up to the middle chromosphere. We analyzed the azimuthal and vertical gradient of the magnetic field strength and inclination. Our results provide new insights on the properties of the penumbral magnetic fields in the chromosphere at atmospheric heights unexplored in previous studies. We found signatures of the small-scale spine and intraspine structure of both the magnetic field strength and inclination at all investigated atmospheric heights. In particular, we report typical peak-to-peak variations of the field strength and inclination of ≈300 G and ≈20°, respectively, in the photosphere, and of ≈200 G and ≈10° in the chromosphere. In addition, we estimated the vertical gradient of the magnetic field strength in the studied penumbra: we find a value of ≈0.3 G km−1 between the photosphere and the middle chromosphere. Interestingly, the photospheric magnetic field gradient changes sign from negative in the inner to positive in the outer penumbra.