The compressibility and phase stability of YbB2 are investigated under high pressure using high-resolution synchrotron x-ray diffraction in a diamond anvil cell. The bulk modules of high purity YbB2 is obtained as similar to 182 GPa using the Birch-Murnaghan equation of state. The patterns measured up to 20 GPa and the pressure dependence of normalized lattice parameters, a/a(0) and c/c(0), reveal that the compressibility of YbB2 is low and fairly isotropic, and this material can be classified as a hard material. X-ray photoemission studies demonstrate that Yb in YbB2 has a mostly trivalent valence state at room temperature. Moreover, sample preparation details provide a new insight into the high purity synthesis of YbB2 at ambient pressure and moderate temperatures. The presented structural and compressibility results are in agreement with the available theoretical and experimental data on binary rare-earth borides and can serve as a reliable reference for future studies.