It is important to quickly recognize any physical changes in volcanology and accompanying phenomena at each stage of an eruption in terms of mitigating volcanic eruptions. Automatic classification of the type of volcanic earthquake is required, especially since the data recorded by seismic equipment is classified as big data. Analyzing big data manually will take a lot of time. Therefore, we use unsupervised machine learning such as K-means clustering to generate an automated system of classifying the volcanic events based on their waveform and spectrum characteristics. We examine the clustering of volcanic earthquakes at Anak Krakatau volcano, Sunda Strait during June to July 2014. We use one seismic station which is KRA4 to calculate the K-means clustering at Anak Krakatau volcano. We apply unsupervised machine learning such as K-means clustering to classify volcanic earthquakes. We successfully applied the K-means clustering method and found three clusters that represent the volcanic earthquake types based on the characteristics of the waveform in time and frequency domains. We observed different waveform and frequency characteristics for different clusters. The result is Cluster 1 is characterized by rapid increases in a few seconds, then gradual decreases with time, and the frequency dominant range of 4-4.7 Hz. Cluster 2 is characterized by gradual increases in a few seconds, then gradual decreases with time, and the frequency dominant range of 6-6.5 Hz. Cluster 3 is characterized by gradual increases in a few seconds, then gradual decreases with time in longer duration, and the frequency dominant range of 7-7.5 Hz. This study is useful to automatically classify the big data of daily volcanic activity that is generated continuously to mitigate the volcanic hazard.