Aims. We explore the effect of an inhomogeneous mass density field on frequencies and wave profiles of torsional Alfvén oscillations in solar coronal loops. Methods. Dispersion relations for torsional oscillations are derived analytically in limits of weak and strong inhomogeneities. These analytical results are verified by numerical solutions, which are valid for a wide range of inhomogeneity strength. Results. It is shown that the inhomogeneous mass density field leads to the reduction of a wave frequency of torsional oscillations, in comparison to that estimated from mass density at the loop apex. This frequency reduction results from the decrease of an average Alfvén speed as far as the inhomogeneous loop is denser at its footpoints. The derived dispersion relations and wave profiles are important for potential observations of torsional oscillations which result in periodic variations of spectral line widths. Conclusions. Torsional oscillations offer an additional powerful tool for the development of coronal seismology.