BackgroundIn heroin injectors, there have been a number of outbreaks caused by spore-forming bacteria, causing serious infections such as anthrax or botulism. These are, most likely, caused by injecting contaminated heroin, and our aim was to develop a filter that efficiently removes these bacteria and is also likely to be acceptable for use by people who inject drugs (i.e. quick, simple and not spoil the hit).MethodsA prototype filter was designed and different filter membranes were tested to assess the volume of liquid retained, filtration time and efficiency of the filter at removing bacterial spores. Binding of active ingredients of heroin to different types of membrane filters was determined using a highly sensitive analytical chemistry technique.ResultsHeroin samples that were tested contained up to 580 bacteria per gramme, with the majority being Bacillus spp., which are spore-forming soil bacteria. To remove these bacteria, a prototype filter was designed to fit insulin-type syringes, which are commonly used by people who inject drugs (PWIDs). Efficient filtration of heroin samples was achieved by combining a prefilter to remove particles and a 0.22 μm filter to remove bacterial spores. The most suitable membrane was polyethersulfone (PES). This membrane had the shortest filtration time while efficiently removing bacterial spores. No or negligible amounts of active ingredients in heroin were retained by the PES membrane.ConclusionsThis study successfully produced a prototype filter designed to filter bacterial spores from heroin samples. Scaled up production could produce an effective harm reduction tool, especially during outbreaks such as occurred in Europe in 2009/10 and 2012.Electronic supplementary materialThe online version of this article (doi:10.1186/s12954-016-0122-1) contains supplementary material, which is available to authorized users.