also: たんびに
adverb
each time; every time; whenever
Used after a verb or noun to express that something happens on every occurrence of that action or event. Often translated as 'whenever' or 'each time'.
彼女に会うたびに、心がときめく。
Every time I see her, my heart flutters.
この曲を聴くたびに、故郷を思い出す。
Whenever I listen to this song, I remember my hometown.
ごとに also means 'each' or 'every', but it emphasizes regular intervals or individual items in a group, while たびに focuses on the recurrence of an event or action.
Derived from the noun 度 (たび, 'time, occasion') combined with the particle に. The reading たんびに is a colloquial variant with an inserted ん for emphasis.