Abstract. The studied area of the northwestern (NW) Dinarides is located in the northeastern (NE) corner of the Adriatic microplate and is bordered by the Adriatic foreland, the Southern Alps, and the Pannonian basin. Its complex crustal structure is the result of interactions among different tectonic units, the most important of which are the Eurasian plate and the Adriatic microplate. Despite numerous seismic studies in this tectonically complex area, there is still a need for a detailed, small-scale study focusing mainly on the upper, brittle part of the crust. In this work, we investigated the velocity structure of the crust with one-dimensional (1-D) simultaneous hypocenter–velocity inversion using routinely picked P- and S-wave arrival times. Most of the models computed in the combined P and S inversion converged to a stable solution in the depth range between 0 and 26 km. We further evaluated the inversion results with hypocenter shift tests, high- and low-velocity tests, and relocations. This helped us to select the best performing velocity model for the entire study area. Based on these results and the seismicity distribution, we divided the study area into three subregions, reselected earthquakes and stations, and performed the combined P and S inversion for each subregion separately to gain better insight into the crustal structure. In the eastern subregion, the P velocities in the upper 8 km of the crust are lower compared to the regional velocities and the velocities of the other two subregions. The P velocities between 8 and 23 km depth are otherwise very similar for all three models. Conversely, the S velocities between 2 and 23 km depth are highest in the eastern subregion. The NW and southwestern (SW) subregions are very similar in terms of the crustal structure between 0 and 23 km depth, with slightly higher P velocities and lower S velocities in the SW subregion. High vP/vS values were obtained for the layers between 0 and 4 km depth. Below that, no major deviations of vP/vS in the regional model from the value of 1.73 are observed, but in each subregion we can clearly distinguish two zones separated by a decrease in vP/vS at 16 km depth. Compared to the model currently used by the Slovenian Environment Agency to locate earthquakes, the obtained velocity models show higher velocities and agree very well with some of the previous studies. In addition to the general structural implications and the potential to improve the results of seismic tomography, the new 1-D P and S velocity models can also be used for reliable routine earthquake location and for detecting systematic travel time errors in seismological bulletins.