Influenced by local mixing and coastal runoff, water masses in the South China Sea degenerate significantly. The K-means algorithm is used to classify the water masses based on WOD13 temperature and salinity observations from 1966 to 2013 because its principle is consistent with the definition of a shallow water mass. The numbers and initial centers of the water masses are determined using functions of in-cluster distance and density values. The result shows that there are ten water masses in the South China Sea. In combination with the T-S scatter diagram, the properties of the South China Sea water masses were analyzed, including their distribution, the seasonal variability, and the degeneration processes. The temperatures of water masses were higher in summer and lower in winter, with the amplitudes of variation gradually reduced from the surface to the bottom. The seasonal variation in salinity of the surface water masses was high in winter and low in summer, which mainly depends on the amount of river discharge and precipitation. The subsurface water masses were strongly affected by water from the Pacific Ocean; thus, the seasonal variability of these water masses is weak, especially for the intermediate water mass that characterized by prominent low salinity. The water mass formed by the Kuroshio water invading the South China Sea has insignificant seasonal variations in temperature and salinity. The properties and seasonal variabilities of the water masses derived from the K-means algorithm are in agreement with the existing conclusions, suggesting that the improved K-means algorithm is efficient and accurate in the shallow water mass division.