Because Helicobacter pylori has a role in the pathogenesis of gastric cancer, chronic gastritis and peptic ulcer disease, detection of its viable form is very important. The objective of this study was to optimize a PCR method using ethidium monoazide (EMA) or propidium monoazide (PMA) for selective detection of viable H. pylori cells in mixed samples of viable and dead bacteria. Before conducting the real-time PCR using SodB primers of H. pylori, EMA or PMA was added to suspensions of viable and/or dead H. pylori cells at concentrations between 1 and 100 μM. PMA at a concentration of 50 μM induced the highest DNA loss in dead cells with little loss of genomic DNA in viable cells. In addition, selective detection of viable cells in the mixtures of viable and dead cells at various ratios was possible with the combined use of PMA and real-time PCR. In contrast, EMA penetrated the membranes of both viable and dead cells and induced degradation of their genomic DNA. The findings of this study suggest that PMA, but not EMA, can be used effectively to differentiate viable H. pylori from its dead form.