Constructing visual vocabularies in the bag of visual word (BoVW) model is a critical step, most visual vocabularies is generated either by the k-means algorithm or its improved algorithm. Visual vocabularies generated by these methods have the problem of low discriminative and long running time. For these problems, a BoVW model is proposed based on binary hashing and space pyramid. Firstly, extract the local feature points from the images. Second, learn binary hashing functions, which map the local feature points into visual words, and filter the visual words and generate the visual vocabularies whose visual word is binary hash code. Third, Combined with spatial pyramid matching model, the new BoVW model represents the image by the histogram vector of space pyramid. Finally, the BoVW model is used in image classification and retrieval to verify the effectiveness of the model. Experimental results on the common datasets show that visual vocabularies in our model has higher discriminative and expression ability. Compared with other methods, our model has higher classification accuracy and better retrieval performance.