The use of topology optimization in structural design under dynamic excitation is becoming more prevalent in the literature. While many such applications utilize frequency or time domain formulations, relatively few consider stochastic dynamic excitations. This paper presents an efficient and compact code called TopSTO for structural topology optimization considering stationary stochastic dynamic loading using a method derived from random vibration theory. The theory, described in conjunction with the implementation in the provided code, is illustrated for a seismically excited building. This work demonstrates the efficiency of the approach in terms of both the computational resources and minimal amount of code required. This code is intended to serve as a baseline for understanding the theory and implementation of this topology optimization approach and as a foundation for additional applications and developments.