Accurately determining the pore structure and heterogeneity characteristics of marine-continental transitional shale in the Taiyuan Formation is crucial for evaluating the shale gas resources in the 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 the 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 micropore’s specific surface area and volume are 4.7 and 3.5 times the corresponding shale, respectively. In addition, the microporous heterogeneity of the isolated kerogen is stronger than that of shale, while the mesoporous heterogeneity is exactly the opposite. Meanwhile, the micropores fractal dimension Dm is positively correlated with organic matter (OM) content, while mesopores fractal dimension D1 and D2 are negatively linearly correlated with TOC content and have no significant relationship with clay mineral and quartz content (but show a significant positive correlation with illite and illite/smectite mixed layer). Isolated kerogen plays an important role in the pore (especially micropores) heterogeneity of shale, while other minerals (such as clay minerals) have a controlling effect on the mesopores heterogeneity of shale. Compared with marine shale, the marine-continental transitional shale of the Taiyuan Formation has a lower fractal dimension and better connectivity, which is conducive to shale gas seepage and migration. The final result can provide a significant basis for the reserve evaluation and the optimization of desert areas in the marine-continental transitional shale gas in the northern Ordos Basin.