The desiccation cracks in expansive soil, which are a common natural phenomenon, have a significant negative impact on the engineering properties of the soil and are the direct cause of many engineering problems and geological disasters. This study aims to investigate the influences of sand content and particle size on desiccation cracks of the compacted expansive soil. First, samples of compacted expansive soil with five sand contents and four sand size groups were prepared. Then, a series of drying tests were performed. The dynamic variation of geometric parameters of the surface crack network during evaporation was quantitatively analyzed by using digital image processing technology and fractal theory. The results demonstrated that the increase of the surface-cracking areas in the early and later stages was manifested by the increase of the crack length and crack width, respectively. In the same size of sand particle group (0.15, 0.3 mm), as the sand content (dry weight ratio of soil sample) increased from 0% to 40%, the surface-cracking ratio (the ratio of the crack area to the total surface area of the soil sample) showed a decreasing trend (13.20%, 11.42%, 10.50%, 8.98%, and 7.71%, respectively). When the sand content (40%) was the same, as the sand size groups increased from [0.15 mm, 0.3 mm) to [1.18 mm, 2.36 mm), the surface-cracking ratio also presented a decreasing trend (7.71%, 7.69%, 4.35%, and 3.73%, respectively). The changing law of the fractal dimension of cracks was the same as that of the surface crack ratio. During the drying process, the deformation of the sample was characterized by centripetal shrinkage or cracking, which were mainly affected by the boundary conditions of the sample. This research’s results verify the effectiveness of sand to improve the dry-shrinkage characteristics of expansive soil, providing a reference for the improvement of roadbeds and the treatment of soil slopes in expansive soil areas.