Coding HIV-related diagnoses correctly is one of the more nuanced areas of ICD-10-CM coding — and getting it wrong can affect everything from reimbursement to quality reporting. Accurate coding requires more than just knowing the codes; it requires understanding the disease process itself, recognizing how HIV-related conditions are documented, and knowing when each code applies.
This guide breaks down everything coders need to know about HIV coding, from code selection to documentation requirements, with a real-world example to tie it all together.
Understanding HIV as a Disease Process
HIV is a chronic viral infection caused by one of two related retroviruses that progressively damage the immune system over time. The clinical picture varies widely — some patients remain asymptomatic for years, while others progress to acquired immunodeficiency syndrome (AIDS), the most advanced stage of the disease, marked by serious opportunistic infections, malignancies, and other HIV-related complications.
Because the clinical presentation of HIV spans such a wide spectrum, ICD-10-CM coding guidelines require coders to carefully review documentation to determine exactly where a patient falls — whether that’s symptomatic HIV disease, asymptomatic infection status, or another HIV-related classification.

Code Selection: Choosing the Right HIV Code
B20 — HIV Disease
Code B20 is assigned when a patient has symptomatic HIV infection or has ever been diagnosed with an HIV-related illness — even if that illness isn’t currently active. This is a critical point: once a patient meets criteria for B20, that code applies to all future encounters, regardless of how well-controlled their condition becomes.
This means that even patients with an undetectable viral load are still coded B20 if they have a history of HIV disease. Viral suppression doesn’t reverse the coding classification — once symptomatic, always B20.
The instructional note tied to B20 also requires coders to add additional codes for any HIV-related manifestations, ensuring the full clinical picture is captured.
Per the 2026 ICD-10-CM Official Guidelines, when a patient is admitted specifically for an HIV-related condition, B20 is sequenced as the principal diagnosis, followed by codes identifying the related conditions. There’s one notable exception: if the admission is for hemolytic-uremic syndrome associated with HIV disease, code D59.31 is sequenced first, followed by B20.
Importantly, documentation must clearly link the patient’s HIV status to the condition being treated. Simply having HIV and a separate diagnosis isn’t enough — the provider needs to establish that connection in the record for B20 to apply correctly.
Z21 — Asymptomatic HIV Infection Status
Code Z21 applies when a patient has documented HIV-positive status but no symptoms or HIV-related conditions. This code fits situations where the chart simply notes “HIV positive” or “HIV test positive” without evidence of active disease.
A few important rules here:
- Z21 should never be used if the provider documents AIDS or if the patient is being treated for any HIV-related illness — those situations call for B20 instead.
- Z21 still applies to patients on antiretroviral therapy, as long as they remain asymptomatic. In these cases, code Z79.899 (long-term current drug therapy) can be added to reflect ongoing medication use.
- If the medication is being used for prophylaxis rather than treatment of confirmed HIV infection, the correct code is Z29.81 (encounter for HIV pre-exposure prophylaxis) — not Z21.
R75 — Inconclusive Laboratory Evidence of HIV
When lab results come back indeterminate, code R75 is used until a definitive diagnosis is confirmed.
Here’s where HIV coding deviates from typical inpatient guidelines: normally, coders can report conditions documented as “suspected,” “probable,” or “possible” at discharge. HIV is an exception. Only confirmed cases can be coded as HIV infection in both inpatient and outpatient settings.
That said, “confirmation” doesn’t require a positive lab result in the chart. If the provider’s diagnostic statement clearly indicates the patient is HIV-positive or has an HIV-related illness, that’s sufficient to support code assignment. When documentation is ambiguous, a provider query is the right move.
One more critical rule: once a patient has been assigned B20, they should never again be coded R75 or Z21 — regardless of current symptoms or lab findings.
Other HIV-Related Codes Worth Knowing
While B20, Z21, and R75 cover the majority of HIV-related encounters, several other codes come into play depending on clinical circumstances:
Z11.4 — Encounter for HIV screening, used when a patient is tested for HIV without any signs, symptoms, or confirmed diagnosis (such as routine testing during a hospital admission)
B97.35 — HIV type 2 as the cause of diseases classified elsewhere, used as an additional code to identify HIV-2 as the underlying cause of a condition coded in another chapter
Z20.6 — Contact with and suspected exposure to HIV, used when a patient has known or suspected exposure but no confirmed diagnosis
Z71.7 — HIV counseling, assigned when counseling related to HIV is provided (any signs or symptoms prompting the counseling should be coded as well)
Because these codes are reported less frequently, careful documentation review is especially important to ensure accurate assignment and proper sequencing.
Documentation Essentials for Accurate HIV Coding
Strong documentation is the foundation of accurate HIV coding. Here’s what needs to be in the chart:
Symptomatic vs. Asymptomatic Status
Providers must clearly specify whether the patient has symptomatic HIV disease or asymptomatic HIV infection status, since this distinction directly determines whether B20 or Z21 applies. And remember — once a patient progresses to symptomatic HIV disease and receives a B20 designation, that classification sticks for all future encounters, even after successful treatment brings them back to a stable, asymptomatic state.
Risk Factors
When clinically relevant, documentation should include any known risk factors for HIV acquisition or exposure — things like unprotected sexual contact, needle sharing, occupational exposure to contaminated blood or bodily fluids, perinatal exposure, or contact with HIV-positive individuals. While these factors don’t always directly affect code assignment, they provide valuable clinical context and may support exposure-related or counseling code assignment.
HIV-Related Conditions and Opportunistic Infections
Providers should document all HIV-related conditions and opportunistic infections clearly. Common examples include:
- Recurrent pneumonia
- Tuberculosis
- Kaposi’s sarcoma
- Herpes simplex infections
- Candidiasis involving the esophagus, bronchi, trachea, or lungs
When these conditions are documented by the provider, they generally support B20 assignment alongside codes identifying the specific manifestation. This level of detail matters — it affects disease severity classification, treatment decisions, reimbursement, and quality measures.
Viral Load, CD4 Counts, and Treatment Response
Documentation should also capture changes in viral load, CD4 cell counts, medication adherence, and overall treatment response.
For context: a normal CD4 count ranges from 500 to 1,400 cells per cubic millimeter. Without antiretroviral therapy, CD4 counts decline over time, and once they drop below 200 cells per cubic millimeter, patients become vulnerable to a wide range of opportunistic infections — some of which can be life-threatening.
Providers should document antiretroviral therapy regimens, treatments for opportunistic infections, prophylactic therapies, and management strategies for HIV-associated malignancies or complications. This level of detail supports medical necessity and paints a complete picture of the ongoing care these patients require.
Real-World Coding Example
Let’s walk through a practical scenario:
A 55-year-old patient with a personal history of end-stage renal disease presents to the hospital with influenza. The patient also has a past medical history of HIV disease and is currently on antiretroviral therapy. Although the patient previously had CD4 counts below 200, the provider’s diagnostic statement for this encounter reads: “HIV disease on ARVs (CD4 335, VL undetectable)” — listed as a secondary diagnosis.
According to AHA Coding Clinic, Fourth Quarter 2020, the correct code here is B20.
Why? Because this patient has a documented history of HIV disease. Once that diagnosis has been established, B20 applies on every subsequent encounter — regardless of improved CD4 counts, undetectable viral load, or the absence of current symptoms. Patients who have ever met the criteria for HIV disease are never coded back down to Z21, even when they’re clinically stable and responding well to treatment.
As always, if documentation is unclear or conflicting, a provider query is the appropriate next step.
Key Takeaways for HIV Coding Accuracy
Getting HIV coding right comes down to a few core principles:
- B20 is permanent once assigned — improvement in clinical status never reverses it back to Z21 or R75
- Z21 requires true asymptomatic status — no AIDS diagnosis, no active treatment for HIV-related illness
- Confirmation for HIV coding relies on the provider’s diagnostic statement, not necessarily lab results
- Documentation must establish a clear link between HIV status and any related condition before B20 supports that connection
- When in doubt, query the provider — ambiguous documentation is one of the most common sources of HIV coding errors
Mastering these distinctions doesn’t just improve coding accuracy — it ensures patients’ complete clinical pictures are reflected in their records, supporting appropriate care, reimbursement, and quality reporting.



