Objective: Our study aims to evaluate the association between heart rate variability (HRV) and short and long-term prognosis in patients admitted to intensive care unit (ICU). Methods and Results: Adult patients continuously monitored for over 24h in ICUs from the MIMIC-IV Waveform Database were recruited in our study. Twenty HRV-related variables (8 time-domain, 6 frequency-domain; and 6 nonlinear variables) were calculated based on RR intervals. The association between HRV and 30-day all-cause mortality was assessed. Ninety-three patients met the inclusion criteria and were classified into 30-day survivor group and non-survivor groups based on their survival status. The 30-day all-cause mortality rate was 17.2%. NN50 and pNN50 were both significantly higher in non-survivors compared to survivors, whereas the rest of the time-domain, frequency domain and non-linear HRV parameters did not differ significantly between the two groups (all P >0.05). In addition, at 180 days after admission, non-survivors had significantly higher levels of NN50 and rMSSD than the survivors. However, NN50 was not an independent predictor of 30-day all-cause mortality in patients by multivariate COX regression analysis (HR, 1.0; 95% CI, 1.000 - 1.001; P =0.594). The Area Under the Curve (AUC), cut-off value, sensitivity and specificity of NN50 for predicting 30-day all-cause mortality using ROC were 0.67, 799, 0.813 and 0.584, respectively. Plotting Kaplan-Meier analysis using this cut-off value showed that patients with high NN50 had considerably greater 30-day all-cause mortality than those with low NN50 (P < 0.001). Conclusion: NN50 and pNN50 are associated with elevated 30-day all-cause mortality in ICU patients but are not independent predictors of all-cause mortality using multivariate COX regression analysis.