To study the size effect of rock under quasistatic and dynamic conditions, the changes in compressive strength with the change in specimen size are measured. Cylindrical granite specimens with length-diameter ratios in the range of 0.5∼1 are used for uniaxial compression tests using an RMT testing machine and an SPHB impact testing machine. Under quasistatic loading, the failure modes of the specimens with different length-diameter ratios are different. The larger the size of the specimen structure is, the greater the probability of defects such as joints and micro cracks is and the smaller the influence of the specimen on the distribution of a three-dimensional stress state is. The rock strength decreases with increasing length-diameter ratio. Using the improved Weibull formula, the size of the specimen is expressed by the volume, and the calculated rock strength of different volumes is similar to the compressive strength from the quasistatic tests. Under dynamic loading, the dynamic compressive strengths of the specimens with different length-diameter ratios are similar, and the failure mode of the specimens is different from that under quasistatic loading. Soon after a crack appears in a specimen, the specimen splits. As the size of the specimens decreases, the fragments size to approach the millimeter scale. By improving the Weibull distribution formula and considering variation in strain rate caused by the size of the specimen, the dynamic compressive strength of rocks of different volumes is calculated by introducing the critical strain rate and related parameters, and the results are similar to the experimental dynamic compressive strength obtained. The improved Weibull formula based on the strength size effect can accurately describe the quasistatic and dynamic compressive strength laws.