Helicobacter pylori infection can be diagnosed by invasive techniques requiring endoscopy and biopsy (e.g. histological examination, culture and rapid urease test) and by non-invasive techniques, such as serology, the urea breath test, urine/blood or detection of H. pylori antigen in stool specimen. Some non-invasive tests, such as the urea breath test and the stool antigen test, detect active infection: these are called 'active tests'. Non-invasive tests (e.g. serology, urine, near-patient tests) are markers of exposure to H. pylori but do not indicate if active infection is ongoing; these are 'passive tests'. Non-invasive test-and-treat strategies are widely recommended in the primary care setting. The choice of appropriate test depends on the pre-test probability of infection, the characteristics of the test being used and its cost-effectiveness.