Carbazole compounds are widely used in determining the direction of hydrocarbon migration, but the effect of thermal maturity on carbazoles remains unclear. In this paper, using compaction pyrolysis simulation experiments, artificial mature samples with vitrinite reflectance (Ro) range from 0.38–3.0% were acquired. And the content and composition change characteristics of carbazole compounds were analyzed. The results showed that thermal maturity had a significant influence on the content of carbazole compounds. Compared with the low mature stage, the content of carbazole compounds was about 10 to 100 times higher in the mature stage. With the increasing maturity, in the coal sample, the content of carbazole compounds showed a trend of first increasing and then decreasing. The formation of carbazole compounds was later than generation of hydrocarbon, suggesting carbazoles mainly produced by the thermal degradation of kerogen. In derivatives of carbazole, the corresponding maturity for the maximum generation of ethylcarbazole (EC), dimethylcarbazole (DMCA), methylcarbazole (MCA), carbazole (CA) and benzocarbazole (BCA) performed the increasing sequence. The timing of reaching the maximum content of carbazole compounds is related to the number and type of substituents. The more substituents and longer branches result earlier formation peak. With the increasing maturity, the relative abundance of 2-MCA, 1,7-DMCA and benzo[a]carbazole increased with the increasing maturity, the relative abundance of 1,5-DMCA remained almost unchanged, while 4-MCA, 1,4-DMCA and benzo[c]carbazole gradually decreased. The commonly used parameters as indicators of hydrocarbon migration were greatly affected by maturity. Therefore, when using carbazole compounds as geochemical parameters, it is necessary to fully consider the impact of thermal maturity on them, and avoid transport fractionation or other factors masking the true maturity effect.