Context. Variability is a key factor for understanding the nature of the most massive stars, the OB stars. Such stars lie closest to the unstable upper limit of star formation. Aims. In terms of statistics, the data from the HIPPARCOS satellite are unique because of time coverage and uniformity. They are ideal to study variability in this large, uniform sample of OB stars. Methods. We used statistical techniques to determine an independant threshold of variability corresponding to our sample of OB stars, and then applied an automatic algorithm to search for periods in the data of stars that are located above this threshold. We separated the sample stars into 4 main categories of variability: 3 intrinsic and 1 extrinsic. The intrinsic categories are: OB main sequence stars (∼2/3 of the sample), OBe stars (∼10%) and OB Supergiant stars (∼1/4).The extrinsic category refers to eclipsing binaries. Results. We classified about 30% of the whole sample as variable, although the fraction depends on magnitude level due to instrumental limitations. OBe stars tend to be much more variable (≈80%) than the average sample star, while OBMS stars are below average and OBSG stars are average. Types of variables include α Cyg, β Cep, slowly pulsating stars and other types from the general catalog of variable stars. As for eclipsing binaries, there are relatively more contact than detached systems among the OBMS and OBe stars, and about equal numbers among OBSG stars.