Analogous to the biologically abundant protein-based linear molecular machines that translocate along their target surface, we have recently constructed the DNA-based synthetic molecular motors that effect linear movement or navigate a network of tracks on a DNA origami substrate. However, a DNA-based molecular machine with rotary function, analogous to rotary proteins, is still unexplored. Here, we report the construction of a rotary motor based on the B-Z conformational transition of DNA and the direct and real-time observation of its function within a frame-shaped DNA origami. The motor can be switched off by introducing conditions that stabilize B-DNA, while it can be fueled by adding Z-DNA-promoting high-saline buffer. When MgCl(2) was used as external stimulus, 70% of the motors rotated, while 76% of the stators/controls exhibited no rotation. Such a motor system could be successfully applied to perform multiple actions aimed for our benefit. Moreover, for the first time we have directly observed the B-Z conformational transition of DNA in real-time, which shed light on the fundamental understanding of DNA conformations.