The objective of this study was to evaluate soil macrofauna as a bioindicator of soil quality in successional agroforestry systems and secondary forests. The study was conducted in the southern lower region of Bahia in Brazil, in two areas: a successional agroforestry system (AFS18) and native forest (NF). AFS18 consists of two species: mahogany (Khaya ivorensis and Khaya grandifoliola), açaí (Euterpe oleracea), cacao (Theobroma cacau) and banana (Musa spp.). Sampling was carried out in the dry (June) and rainy (October) seasons of 2019, and eight soil monoliths were collected in both areas. A total of 889 individuals from the soil macrofauna were sampled. The highest frequency (RF) of taxons occurred in NF in the rainy season, and the groups that stood out were: Oligochaeta with 42% FR in ASF18, Formicide with 33.9% in NF and Isoptera with 58% in AFS18. The macrofauna structure of the soil varied according to the time of collection. The density of macrofauna individuals differed between areas only in the dry season. The highest number of ind.m² was observed in the area NF (378) when compared to ASF18 (196). TOC, Mg2+, Al3+ and CTC were related to AF on both occasions of collection and AFS18 in the rainy season, K+, P and pH were associated with AFS18 in the dry season. The diversity, equitability and richness of the soil macrofauna was greater in AF area. HFA18 in the rainy season was similar to NF, favoring colonization of the area by soil macrofauna organisms.