A study of groundwater flow, quality, and mixing in relation to Wind Cave National Park in western South Dakota was conducted during 2007-11 by the U.S. Geological Survey in cooperation with the National Park Service because of water-quality concerns and to determine possible sources of groundwater contamination in the Wind Cave National Park area. A large area surrounding Wind Cave National Park was included in this study because to understand groundwater in the park, a general understanding of groundwater in the surrounding southern Black Hills is necessary. Three aquifers are of particular importance for this purpose: the Minnelusa, Madison, and Precambrian aquifers. Multivariate methods applied to hydrochemical data, consisting of principal component analysis (PCA), cluster analysis, and an end-member mixing model, were applied to characterize groundwater flow and mixing. This provided a way to assess characteristics important for groundwater quality, including the differentiation of hydrogeologic domains within the study area, sources of groundwater to these domains, and groundwater mixing within these domains. Groundwater and surface-water samples collected for this study were analyzed for common ions (calcium, magnesium, sodium, bicarbonate, chloride, silica, and sulfate), arsenic, stable isotopes of oxygen and hydrogen, specific conductance, and pH. These 12 variables were used in all multivariate methods. A total of 100 samples were collected from 60 sites from 2007 to 2010 and included stream sinks, cave drip, cave water bodies, springs, and wells. In previous approaches that combined PCA with end-member mixing, extreme-value samples identified by PCA typically were assumed to represent end members. In this study, end members were not assumed to have been sampled but rather were estimated and constrained by prior hydrologic knowledge. Also, the end-member mixing model was quantified in relation to hydrogeologic domains, which focuses model results on major hydrologic processes. Finally, conservative tracers were weighted preferentially in model calibration, which distributed model errors of optimized values, or residuals, more appropriately than would otherwise be the case The latter item also provides an estimate of the relative effect of geochemical evolution along flow paths in comparison to mixing. The end-member mixing model estimated that Wind Cave sites received 38 percent of their groundwater inflow from local surface recharge, 34 percent from the upgradient Precambrian aquifer, 26 percent from surface recharge to the west, and 2 percent from regional flow. Artesian springs primarily received water from end members assumed to represent regional groundwater flow. Groundwater samples were collected and analyzed for chlorofluorocarbons, dissolved gasses (argon, carbon dioxide, methane, nitrogen, and oxygen), and tritium at selected sites and used to estimate groundwater age. Apparent ages, or model ages, for the Madison aquifer in the study area indicate that groundwater closest to surface recharge areas is youngest, with increasing age in a downgradient direction toward deeper parts of the aquifer. Arsenic concentrations in samples collected for this study ranged from 0.28 to 37.1 micrograms per liter (μg/L) with a median value of 6.4 μg/L, and 32 percent of these exceeded 10 μg/L. The highest arsenic concentrations in and near the study area are approximately coincident with the outcrop of the Minnelusa Formation and likely originated from arsenic in shale layers in this formation. Sample concentrations of nitrate plus nitrite were less than 2 milligrams per liter for 92 percent of samples collected, which is not a concern for drinking-water quality. Water samples were collected in the park and analyzed for five trace metals (chromium, copper, lithium, vanadium, and zinc), the concentrations of which did not correlate with arsenic. Dye tracing indicated hydraulic connection between three water bodies in Wind Cave.