Scanning transmission x-ray microscopy (STXM) is a unique measurement technique to perform nanoscale x-ray spectroscopy. In this review, we briefly introduce soft x-ray spectroscopy and microscopy technique, and also describe recent results on magnetic imaging and nanoscale x-ray circular dichroism spectroscopy on magnetic materials using STXM.