• The size effect of ultra-high performance concrete under compression was investigated through considering the influence of steel fiber characteristics and water-binder ratio. • Weibull statistical theory of size effect and SEL were employed to simulate the size effect of the compressive strength of UHPC. • The compressive strength-specimen size relationships of UHPC with different fiber contents and w/b ratios were established. • UHPC with short hooked fiber showed the greatest size effect, while that with long hooked fiber exhibited the lowest effect. • UHPC with a low w/b ratio showed a more significant size effect under compression. • SEL was more robust and reliable in predicting the compressive strength of UHPC in terms of fiber content, w/b ratio, and specimen size. Understanding the size effect of UHPC under compression is fundamental and essential for component and/or structure design and analysis. This paper investigated the size effect of UHPC cubes (40, 70.7, 100, and 150 mm) under compression through considering the steel fiber characteristics (1%, 2%, 3% short straight, short hooked, and long hooked steel fibers) and water-to-binder ratios (0.16, 0.18, 0.2 and 0.22). Bažant size effect law (SEL) and Weibull statistical theory of size effect were employed to analyze the influence of those factors on the size effect of compressive behavior of UHPC. Results showed the size effect of compressive strength of UHPC increased with the increase of short straight fiber content, but decreased with the increase of w/b ratio. Given the fiber content, UHPC with short hooked fiber showed the greatest size effect, while that with long hooked fiber exhibited the lowest size effect. SEL was more robust and reliable in predicting the change in compressive strength of UHPC with specimen size. The fitted compressive strength from SEL was more accurate with the increase in fiber content and the decrease in w/b ratio.