Machine learning methods can automatically extract inherent structural features in data, thus widely used for vibration feature extraction. However, it is very challenging to make a balance between generalizability and diagnostic accuracy on the extracted features. The variational autoencoder describes the observations in the latent space in a probabilistic way, so that the extracted latent space features have a good generalization ability. This paper develops the Binary Variational Autoencoder (BVAE), dedicated to describing the machine condition information carried by the vibration signals in a probabilistic way. The BVAE maps vibration signals into a latent space to extract machine condition information and binarizes them, resulting in a compact machine condition hash (MCH). The effectiveness of the developed method was verified using the Case Western Reserve University bearing data set. The results show that the machine conditional hash extracted by the BVAE can balance low dimensionality and high discriminability, achieving a diagnostic accuracy over 99%.