Abstract Uncertainties in stellar structure and evolution theory are largest for stars undergoing core convection on the main sequence. A powerful way to calibrate the free parameters used in the theory of stellar interiors is asteroseismology, which provides direct measurements of angular momentum and element transport. We report the detection and classification of new variable O and B stars using high-precision short-cadence (2 minutes) photometric observations assembled by the Transiting Exoplanet Survey Satellite (TESS). In our sample of 154 O and B stars, we detect a high percentage (90%) of variability. Among these we find 23 multiperiodic pulsators, 6 eclipsing binaries, 21 rotational variables, and 25 stars with stochastic low-frequency variability. Several additional variables overlap between these categories. Our study of O and B stars not only demonstrates the high data quality achieved by TESS for optimal studies of the variability of the most massive stars in the universe, but also represents the first step toward the selection and composition of a large sample of O and B pulsators with high potential for joint asteroseismic and spectroscopic modeling of their interior structure with unprecedented precision.