Objective. Electrical stimulation via microelectrodes implanted in cortex has been suggested as a potential treatment for a wide range of neurological disorders. Despite some success however, the effectiveness of conventional electrodes remains limited, in part due to an inability to create specific patterns of neural activity around each electrode and in part due to challenges with maintaining a stable interface. The use of implantable micro-coils to magnetically stimulate the cortex has the potential to overcome these limitations because the asymmetric fields from coils can be harnessed to selectively activate some neurons, e.g. vertically-oriented pyramidal neurons while avoiding others, e.g. horizontally-oriented passing axons. In vitro experiments have shown that activation is indeed confined with micro-coils but their effectiveness in the intact brain of living animals has not been evaluated. Approach. To assess the efficacy of stimulation, a 128-channel custom recording microelectrode array was positioned on the surface of the visual cortex (ECoG) in anesthetized mice and responses to magnetic and electric stimulation were compared. Stimulation was delivered from electrodes or micro-coils implanted through a hole in the center of the recording array at a rate of 200 pulses per second for 100 ms. Main results. Both electric and magnetic stimulation reliably elicited cortical responses, although activation from electric stimulation was spatially expansive, often extending more than 1 mm from the stimulation site, while activation from magnetic stimulation was typically confined to a similar to 300 mu m diameter region around the stimulation site. Results were consistent for stimulation of both cortical layer 2/3 and layer 5 as well as across a range of stimulus strengths. Significance. The improved focality with magnetic stimulation suggests that the effectiveness of cortical stimulation can be improved. Improved focality may be particularly attractive for cortical prostheses that require high spatial resolution, e.g. devices that target sensory cortex, as it may lead to improved acuity.