Batam waters are one of the busiest shipping lanes in Indonesia, with high ship traffic density and complex movement patterns. This condition requires data analysis techniques that can accurately identify and adapt ship movement patterns. The purpose of this study is to study ship movement patterns using Automatic Identification System (AIS) data, and also to see how the K-Means and DBSCAN algorithms work in the data clustering process. The AIS data used includes geographic coordinates, observation time, speed, and direction of ship movement in Batam waters. This study includes the application of the K-Means and DBSCAN algorithms, feature extraction and normalization, and data pre-processing to improve data quality. Internal validation metrics used to assess cluster quality are the Silhouette Score and the Davies–Bouldin Index. The results of the study show that the DBSCAN algorithm has a better level of cluster cohesion and separation between clusters than K-Means. The K-Means algorithm produces a Silhouette Score value of 0.48 and a Davies–Bouldin Index value of 0.91, while the DBSCAN algorithm produces a Silhouette Score value of 0.62 and a Davies–Bouldin Index value of 0.67. In addition, DBSCAN can find sound data of 19.96% of the data set, which indicates abnormal ship movements or does not form a certain density pattern. The results show that the DBSCAN algorithm analyzes ship movement patterns with AIS data in the Batam waters better than K-Means. This research is expected to be the basis for the development of maritime information systems that help monitor ship traffic, make decisions about safety, and manage waters.