Heterogeneous access to sanitation services is a characteristic of communities in Brazil. This heterogeneity leads to different patterns of hepatitis A endemicity: areas with low infection rates have higher probability of outbreaks, and areas with higher infection rates have high prevalence and low risk of outbreaks. Here we develop a mathematical model to study the effect of variable exposure to infection on the epidemiological dynamics of hepatitis A. Differential equations were used to simulate population dynamics and were numerically solved using the software StellaTM. The model uses parameters from serological surveys in the Greater Metropolitan Rio de Janeiro, in areas with different sanitation conditions. Computer simulation experiments show that the range of infection rates observed in these communities are characteristic of high and low levels of hepatitis A endemicity. We also found that the functional relationship between sanitation and exposure to infection is an important component of the model. The analysis of the public health impact of partial sanitation requires a better understanding of this relationship.