Accurately determining the pore structure and heterogeneity characteristics of marine-continental transitional shale in Taiyuan Formation is crucial for evaluating the shale gas resources in northern Ordos Basin. However, the studies on pore characteristics and heterogeneity of marine-continental transitional shales and isolated kerogen are limited. This study collected Taiyuan Formation shale in northern Ordos Basin and corresponding kerogen isolated from shale, and used N2 and CO2 adsorption experiment and Frenkel-Halsey-Hill and Volume-Specific Surface Area model to investigate the pore structure and heterogeneity of both. The results show that the isolated kerogen is dominated by micropores, and the micropores specific surface area and volume are 4.7 and 3.5 times of the corresponding shale, respectively. The micropores fractal dimension Dm of isolated kerogen is larger than the mesopores fractal dimension D1 and D2, indicating numerous developed micropores exhibit stronger heterogeneity. The shale micropores fractal dimensions Dm and mesoporous fractal dimensions D2 are close, and the heterogeneity of their micro- and meso- pore structures is similar. In addition, the microporous heterogeneity of the isolated kerogen is stronger than that of shale, while the mesoporous heterogeneity is exactly the opposite. Isolated kerogen plays an important role in the pore (especially micropores) heterogeneity of shale, while other minerals (such as clay minerals and quartz) have a significant controlling effect on the mesopores heterogeneity of shale. Meanwhile, a positive correlation was discovered between Dm and the organic matter (OM) content, while D1 and D2 have a negative linear relation with the TOC content and a positive linear relation with the clay minerals content (especially illite and illite/smectite mixed layer). Compared with marine shale, marine-continental transitional shale of Taiyuan Formation has lower fractal dimension and better connectivity, which is conducive to shale gas seepage and migration, but not conducive to its preservation. The final result can provide significant basis for the reserve evaluation and the optimization of dessert areas in the marine-continental transitional shale gas in the northern Ordos Basin.