Noninvasive brain stimulation with transcranial magnetic stimulation (TMS) or transcranial direct current stimulation (tDCS) is valuable in research and has potential therapeutic applications in cognitive neuroscience, neurophysiology, psychiatry, and neurology. TMS allows neurostimulation and neuromodulation, while tDCS is a purely neuromodulatory application. TMS and tDCS allow diagnostic and interventional neurophysiology applications, and focal neuropharmacology delivery. However, the physics and basic mechanisms of action remain incompletely explored. Following an overview of the history and current applications of noninvasive brain stimulation, we review stimulation device design principles, the electromagnetic and physical foundations of the techniques, and the current knowledge about the electrophysiologic basis of the effects. Finally, we discuss potential biomedical and electrical engineering developments that could lead to more effective stimulation devices, better suited for the specific applications.