Caerdydd (the Welsh name of the city) derives from the earlier Welsh form Caerdyf. The change from -dyf to -dydd shows the colloquial alteration of Welsh f[v] and dd[ð], and was perhaps also driven by folk etymology (dydd is Welsh for 'day' whereas *dyf has no obvious meaning). This sound change had probably first occurred in the Middle Ages; both forms were current in the Tudor period. Caerdyf has its origins in post-RomanBrythonic words meaning "the fort of the Taff". The fort probably refers to that established by the Romans. Caer is Welsh for fort and -dyf is in effect a form of Taf (Taff), the river which flows by Cardiff Castle, with the ⟨t⟩ showing consonant mutation to ⟨d⟩ and the vowel showing affection as a result of a (lost) genitive case ending.
The anglicised form Cardiff is derived from Caerdyf, with the Welsh f[v] borrowed as fff/, as also happens in Taff (from Welsh Taf) and Llandaff (from Welsh Llandaf). As English does not have the vowel [ɨ] the final vowel has been borrowed as ɪ/.
The antiquarian William Camden (1551–1623) suggested that the name Cardiff may derive from *Caer-Didi ("the Fort of Didius"), a name supposedly given in honour of Aulus Didius Gallus, governor of a nearby province at the time when the Roman fort was established. Although some sources repeat this theory, it has been rejected on linguistic grounds by modern scholars such as Professor Gwynedd Pierce.