Atrial fibrillation (AF) is the most common cardiac rhythm disorder and the prevalence is increasing. The disease confers an increased risk of severe complications such as heart failure, stroke and death, yet the treatment options available are insufficient. AF can develop secondary to other diseases, but there is also evidence of a heritable component. The molecular basis for the heritability of AF has been explored in depth over the past decade. Rare variants have been identified in ion channels, transcription factors and a wide range of other genes. More recently, common variant analyses have identified 14 genetic loci associated with AF. Thus, the genetics of AF is complex and heterogeneous. In this review, we describe the common and rare variants identified for AF, the potential clinical implications of these variants and the future directions in this field. Increasing our understanding of the pathophysiology of AF will aid the development of new and improved treatment strategies and risk prediction of AF, the first steps toward a more individualized treatment of the arrhythmia.