An accurate urine test for pulmonary tuberculosis (TB), affecting 9.6 million patients worldwide, is critically needed for surveillance and treatment management. Past attempts failed to reliably detect the mycobacterial glycan antigen lipoarabinomannan (LAM), a marker of active TB, in HIV-negative, pulmonary TB–infected patients’ urine (85% of 9.6 million patients). We apply a copper complex dye within a hydrogel nanocage that captures LAM with very high affinity, displacing interfering urine proteins. The technology was applied to study pretreatment urine from 48 Peruvian patients, all negative for HIV, with microbiologically confirmed active pulmonary TB. LAM was quantitatively measured in the urine with a sensitivity of >95% and a specificity of >80% (n = 101) in a concentration range of 14 to 2000 picograms per milliliter, as compared to non-TB, healthy and diseased, age-matched controls (evaluated by receiver operating characteristic analysis; area under the curve, 0.95; 95% confidence interval, 0.9005 to 0.9957). Urinary LAM was elevated in patients with a higher mycobacterial burden (n = 42), a higher proportion of weight loss (n = 37), or cough (n = 50). The technology can be configured in a variety of formats to detect a panel of previously undetectable very-low-abundance TB urinary analytes. Eight of nine patients who were smear-negative and culture-positive for TB tested positive for urinary LAM. This technology has broad implications for pulmonary TB screening, transmission control, and treatment management for HIV-negative patients.