Objective: To explore the feasibility of applying machine-learning hierarchical clustering algorithm to waveform-type automatic classification and diagnosis in congenital nystagmus (CN). Methods: A retrospective case series study. A total of 90 patients (90 eyes) diagnosed with CN at Tianjin Eye Hospital from December 2018 to September 2019 were included in the study, including 67 males and 23 females, aged (12±9) years old. Eye movement waveforms were recorded with the video eye tracker in all patients. Analyses with unsupervised machine-learning hierarchical clustering algorithm were performed on the normalized eye movement waveforms. The visualized clustering results were obtained for further waveform naming. The occurrence rate of each waveform type was calculated, and the correlation between the proportion of each waveform type and the visual function of CN patients was analyzed. Independent sample t-test and Pearson correlation analysis were used for statistical analysis. Results: The 46 620 cycles of validated waveforms from the 90 CN patients were categorized into 7 types of waveforms through machine-learning hierarchical clustering algorithm, named type Ⅰ, type Ⅱ, type Ⅲ, and types Ⅳ1-4, respectively. In the 46 620 cycles of eye movement waveforms from the 90 patients with CN, there were 14 259 cycles of type Ⅰ (30.59%), 11 498 cycles of type Ⅱ (24.66%), 4 083 cycles of type Ⅲ (8.76%), 5 430 cycles of type Ⅳ1 (11.65%), 3 451 cycles of type Ⅳ2 (7.40%), 3 015 cycles of type Ⅳ3 (6.47%), 2 663 cycles of type Ⅳ4 (5.71%) and 2 221 cycles of unclassified waveforms (4.76%). The waveforms of types Ⅰ, Ⅱ and Ⅲ corresponded to the 3 basic CN eye movement waveforms (velocity-increasing jerk waveform, velocity-decreasing jerk waveform and pendular waveform) described in the textbooks, and the waveforms of types Ⅳ1-4 were complex waveforms. The proportions of patients with the 7 types of waveforms were 78.89% (71 cases), 41.11% (37 cases), 17.78% (16 cases), 20.00% (18 cases), 7.78% (7 cases), 15.56% (14 cases) and 11.11% (10 cases), respectively. According to the results of automatic classification, 38 (42.22%) CN patients presented with only one type of waveforms, and the remaining 52 (57.78%) CN patients presented with two or more types of waveforms, including 23 (25.56%) patients with 3 or more types of waveforms and 5 (5.56%) patients with 4 types of waveforms. The proportions of type Ⅰ component were significantly correlated with the patients' best corrected visual acuities (BCVAs;logarithm of the minimum angle of resolution) (r=-0.39; P<0.01), and there was no relationship between the proportions of type Ⅱ component and the patients' BCVAs (P>0.05). The BCVAs of the patients with type Ⅰ as the dominant component were better than those of the patients with type Ⅱ as the dominant component, with statistically significant difference (0.19±0.14 vs. 0.45±0.37;t=2.77; P<0.05). Conclusion: Machine-learning hierarchical clustering algorithm can be used for waveform-type automatic classification and discrimination in CN and provide an auxiliary method for the precise diagnosis and evaluation of the disease.