Although two binding sites might be dissimilar overall, they might still bind the same fragments if they share suitable subpockets. Information about shared subpockets can be therefore used in fragment-based drug design to suggest new fragments or to replace existing fragments within an already known compound. A novel computational method called SubCav is described which allows the similarity searching and alignment of subpockets from a PDB-wide database against a user-defined query. The method is based on pharmacophoric fingerprints combined with a subpocket alignment algorithm. SubCav was shown to be effective in producing reasonable alignments for subpockets with low sequence similarity and be able to retrieve relevant subpockets from a large database of structures including those with different folds. It can also be used to analyze subpockets inside a protein family to facilitate drug design and to rationalize compound selectivity.