Different pain types may be encoded in different brain circuits. Here, we examine similarities and differences in brain processing of visceral and somatic pain. We analyze data from seven fMRI studies (N = 165) and five types of pain and discomfort (esophageal, gastric, and rectal distension, cutaneous thermal stimulation, and vulvar pressure) to establish and validate generalizable pain representations. We first evaluate an established multivariate brain measure, the Neurologic Pain Signature (NPS), as a common nociceptive pain system across pain types. Then, we develop a multivariate classifier to distinguish visceral from somatic pain. The NPS responds robustly in 98% of participants across pain types, correlates with perceived intensity of visceral pain and discomfort, and shows specificity to pain when compared with cognitive and affective conditions from twelve additional studies (N = 180). Pre-defined signatures for non-pain negative affect do not respond to visceral pain. The visceral versus the somatic classifier reliably distinguishes somatic (thermal) from visceral (rectal) stimulation in both cross-validation and independent cohorts. Other pain types reflect mixtures of somatic and visceral patterns. These results validate the NPS as measuring a common core nociceptive pain system across pain types, and provide a new classifier for visceral versus somatic pain.