We analyzed the sealing effectiveness of cap rocks bearing different types of stylolites using a combination of petrographic, petrophysical, pore structure, and sealing capacity characterization techniques. This study was based on examples of carbonate cap rocks that seal ultradeep hydrocarbon reservoirs of the Tarim Basin (China). Samples from both drill cores and their outcrop analogues were investigated to quantify how morphology influences the sealing capacity of different types of stylolite-bearing rocks. The study cap rocks consisted of mudstone, wackestone to packstone, grainstone, and dolomitic limestone. Four types of stylolites were identified: rectangular layer, seismogram pinning, suture and sharp peak, and simple wave-like types. The difference in the sealing capacity of carbonate cap rocks is attributed to their pore structure connections and the types of stylolites they develop. Samples bearing simple wave-like stylolites showed the best sealing capacity, followed by those with rectangular layer and suture and sharp peak types, whereas carbonates hosting seismogram pinning types had the lowest sealing capacity. The impact of stylolite segments on the rock sealing properties, however, differed from one segment to another. Rectangular layer–type stylolites could be divided into three distinct segments (with good, moderate, and poor sealing, respectively). Both the seismogram pinning and suture and sharp peak stylolite types were divided in two parts, with the former one having moderate and poor sealing and the latter exhibiting good and moderate sealing. The simple wavelike type had a good sealing capacity all along the pressure-solution seam. The most effective sealing barriers for vertical fluid flow form when (1) calcite and siliceous cements are pervasively distributed in the vicinity of stylolites, forming highly cemented zones with lower porosity and permeability than their surrounding host rocks; (2) stylolites are enriched in insoluble residues; and (3) rare microfractures and dissolution vugs are found along the stylolites. This work provides useful examples for the prediction of the sealing potential of stylolite-bearing carbonate rocks according to stylolite morphology in other geologic settings.