We have developed a new numerical algorithm for inversion of ultrasonic data in transversely isotropic media. This algorithm is able to determine from the measured P-wave velocities the orientation of the symmetry axis of a rock sample and the Thomsen’s parameters, only assuming transverse isotropy. The inversion of ultrasonic data acquired on natural and potentially heterogeneous shale samples produced reasonable results. In addition, the algorithm was successfully tested on ultrasonic data acquired on synthetic samples with predefined orientations of the symmetry axis. An additional outcome of the algorithm is a simple approximation of Thomsen’s formulation, which can be effectively used for interpretation of seismic data in transversely isotropic media.