Organic acids play a key role in central metabolic functions of organisms, are crucial for understanding regulatory processes and are ubiquitous inside the cell. Therefore, quantification of these compounds provides a valuable approach for studying dynamics of metabolic processes, in particular when the organism faces changing environmental conditions. However, the extraction and analysis of organic acids can be challenging and validated methods available in this field are limited. In this study, we developed a method for the extraction and quantification of organic acids from microbial samples based on solid-phase extraction on a strong anionic exchange cartridge and gas chromatographic-mass spectrometric analysis. Full method validation was conducted to determine quality parameters of the new method. Recoveries for 12 of the 15 aromatic and aliphatic acids were between 100 and 111% and detection limits between 3 and 272 ng/mL. The ranges for the regression coefficients and process standard deviations for these compound classes were 0.9874–0.9994 and 0.04–0.69 μg/mL, respectively. Limitations were encountered when targeting aliphatic acids with hydroxy, oxo or enol ester functions. Finally, we demonstrated the applicability of the method on cell extracts of the bacterium Escherichia coli and the dinoflagellate Prorocentrum minimum . Graphical abstract Electronic supplementary material The online version of this article (10.1007/s00216-020-02883-3) contains supplementary material, which is available to authorized users.