DNA has become the biomolecule of choice for molecular computation that may one day complement conventional silicon-based processors. In general, DNA computation is conducted in individual tubes, is slow in generating chemical outputs in response to chemical inputs and requires fluorescence readout. Here, we introduce a new paradigm for DNA computation where the chemical input is processed and transduced into a mechanical output using dynamic DNA-based motors operating far from equilibrium. We show that DNA-based motors with onboard logic (DMOLs) can perform Boolean functions (NOT, YES, AND and OR) with 15 min readout times. Because DMOLs are micrometre-sized, massive arrays of DMOLs that are identical or uniquely encoded by size and refractive index can be multiplexed and perform motor-to-motor communication on the same chip. Finally, DMOL computational outputs can be detected using a conventional smartphone camera, thus transducing chemical information into the electronic domain in a facile manner, suggesting potential applications.