Visceral pain is a particularly difficult symptom to manage in patients with irritable bowel syndrome (IBS). Our aim was to examine whether noninvasive neurostimulation applied to the motor cortex or lumbosacral region can modulate human visceral sensation. Sixteen healthy adult volunteers and 10 patients with IBS were evaluated. Single-pulse lumbosacral magnetic stimulation (LSMS) or transcranial magnetic stimulation (TMS) was used to assess spinal root and cortical excitability as well as the effect of neurostimulation on anorectal sensation and pain, which were provoked by a local electrical stimulus. Initially, healthy volunteers received 6 stimulation paradigms in a randomised order (3 repetitive LSMS [1 Hz, 10 Hz, and sham]) and 3 repetitive TMS (1 Hz, 10 Hz, and sham) to investigate the effects on neural function and visceral sensation over 1 hour. The most effective cortical and spinal interventions were then applied in patients with IBS. Only 1-Hz rLSMS altered healthy anal motor excitability, increasing spinal (58 ± 12.3 vs 38.5 ± 5.7 μV, P = 0.04) but not cortical responses. Both 1-Hz rLSMS and 10-Hz repetitive transcranial magnetic stimulation increased healthy rectal pain thresholds for up to an hour after intervention (P < 0.05). When applied to patients with IBS, rectal pain thresholds were increased across all time points after both 1-Hz rLSMS and 10-Hz repetitive transcranial magnetic stimulation (P < 0.05) compared with sham. The application of magnetoelectric stimuli to the cortical and lumbosacral areas modulates visceral sensation in healthy subjects and patients with IBS. This proof-of-concept study provides supportive evidence for neurostimulation in managing functional gastrointestinal disorders.