Single-molecule and super-resolution imaging relies on successful, sensitive, and accurate detection of the emission from fluorescent molecules. Yet, despite the widespread adoption of super-resolution microscopies, single-molecule data processing algorithms can fail to provide accurate measurements of the brightness and position of molecules in the presence of backgrounds that fluctuate significantly over time and space. Thus, samples or experiments that include obscuring backgrounds can severely, or even completely, hinder this process. To date, no general data analysis approach to this problem has been introduced that is capable of removing obscuring backgrounds for a wide variety of experimental modalities. To address this need, we present the Single-Molecule Accurate LocaLization by LocAl Background Subtraction (SMALL-LABS) algorithm, which can be incorporated into existing single-molecule and super-resolution analysis packages to accurately locate and measure the intensity of single molecules, regardless of the shape or brightness of the background. Accurate background subtraction is enabled by separating the foreground from the background based on differences in the temporal variations of the foreground and the background (i.e., fluorophore blinking, bleaching, or moving). We detail the function of SMALL-LABS here, and we validate the SMALL-LABS algorithm on simulated data as well as real data from single-molecule imaging in living cells.