The invention belongs to the field of basic physical property testing of unconventional oil and gas reservoir engineering and geotechnical engineering and particularly relates to a fractal dimension measuring and calculating method for effective pores of hydrate-containing sediments. Firstly, X-CT gray images of the hydrate-containing sediments are acquired and the porosity is measured; then, thegray images are colored again, X-CT colored images of the hydrate-containing sediments are acquired from two groups with gray values of soil particles, hydrate particles, gas and moisture in obvious comparison, then, X-CT colored images with set thresholds are subjected to binarization processing, black and white images are obtained, the effective porosity of the acquired black and white images isthe same as that of the X-CT gray images, and white and black represent a framework material and a pore fluid respectively. The fractal dimensions of black areas in the black and white images, namely, the fractal dimensions of effective porosity of the hydrate-containing sediments, are solved. The problems that solid framework space and pore fluid space cannot be segmented effectively with existing methods are solved, and the fractal dimensions of effective porosity of the hydrate-containing sediments can be measured and calculated accurately.