Roughly 33 million people worldwide are infected with HIV; disease burden is highest in resource-limited settings. One important diagnostic in HIV disease management is the absolute count of lymphocytes expressing the CD4(+) and CD8(+) receptors. The current diagnostic instruments and procedures require expensive equipment and trained technicians. In response, we have developed microfluidic biochips that count CD4(+) and CD8(+) lymphocytes in whole blood samples, without the need for off-chip sample preparation. The device is based on differential electrical counting and relies on five on-chip modules that, in sequence, chemically lyses erythrocytes, quenches lysis to preserve leukocytes, enumerates cells electrically, depletes the target cells (CD4 or CD8) with antibodies, and enumerates the remaining cells electrically. We demonstrate application of this chip using blood from healthy and HIV-infected subjects. Erythrocyte lysis and quenching durations were optimized to create pure leukocyte populations in less than 1 min. Target cell depletion was accomplished through shear stress-based immunocapture, using antibody-coated microposts to increase the contact surface area and enhance depletion efficiency. With the differential electrical counting method, device-based CD4(+) and CD8(+) T cell counts closely matched control counts obtained from flow cytometry, over a dynamic range of 40 to 1000 cells/μl. By providing accurate cell counts in less than 20 min, from samples obtained from one drop of whole blood, this approach has the potential to be realized as a handheld, battery-powered instrument that would deliver simple HIV diagnostics to patients anywhere in the world, regardless of geography or socioeconomic status.