Atrial fibrillation (AF) is the most common sustained cardiac arrhythmia characterized by consistently irregular atrial and ventricular contractions. Heart rate variability (HRV) refers to the changes in the intervals between consecutive ventricular heartbeats. In sinus rhythm, HRV may be subtle and is quantitatively reflecting the dynamic interplay of the cardiac autonomic nervous system, which plays a crucial role in the onset, development, and maintenance of AF. HRV metrics, consisting of time-domain, frequency-domain, and nonlinear parameters, have been verified to vary significantly before and after AF episodes, and AF treatment-related procedures such as electrical cardioversion, ablation, and surgery of AF. Therefore, HRV may serve as a digital biomarker in predicting AF risk in long-term and acute risk period, identification of patients with AF risk in sinus rhythm and recurrence risk stratification after procedures. HRV in AF rhythm, predominantly influenced by dynamic atrioventricular node conduction under the onslaught of irregular atrial impulses, shows a huge disparity compared to that in sinus rhythm. Despite this, HRV in AF rhythm still provides valuable prognostic information, as reduced HRV may indicate a poor heart function and outcomes in patients with AF. Despite being influenced by lots of variables, HRV can still serve as an independent digital biomarker in the clinical management of AF throughout its entire lifecycle.