Your iPhone has a built-in feature that can tell you if you're listening to music too loud. It's part of iOS 13, but is also featured in Apple's latest Apple Watch software, which can identify if you're in really loud areas for too long.
The iPhone feature I'll show you is specific to headphone volume and will show you if you're playing your tunes a little too loud.
Here's how to check:
Your iPhone will show a summary that looks like this:
The data is pulled from any headphones you use. My list showed some Bose headphones I've connected, and various Beats and Apple headphones I've used. You can toggle the top of the screen to show hourly, daily, weekly, monthly and yearly averages for how loud your headphones were playing. Mine averaged out to 78dB in 2019. My editor's, in the picture above, was 69dB, even better.
Per World Health Organization recommendations by Apple when I wrote a similar story on the feature in Apple Watches, here's the maximum safe level for listening to sound via headphones:
My editor noticed that his dB level dropped to an even safer level after he upgraded to the AirPods Pro, which have noice-cancelling. Because of that feature, he's able to listen to music at lower levels, instead of at max in an effort to drown out background noise on the subway. If your levels are too high, you might consider doing the same.