This paper introduces MagPen, a magnetically driven pen interface that works both on and around mobile devices. The proposed device introduces a new vocabulary of gestures and techniques that increase the expressiveness of the standard capacitive stylus. These techniques are: 1)detecting the orientation that the stylus is pointing to, 2)selecting colors using locations beyond the screen boundaries, 3) recognizing different spinning gestures associated with different actions, 4) inferring the pressure applied to the pen, and 5) uniquely identifying different pens associated with different operational modes. These techniques are achieved using commonly available smartphones that sense and analyze the magnetic field produced by a permanent magnet embedded in a standard capacitive stylus. This paper explores how magnets can be used to expand the design space of current pen interaction, and proposes a new technology to achieve such results.