The cosmic variance on the star formation history may lead to bias in the merger rate density estimation of binary neutron star (BNS) mergers by compact binary population synthesis. In this paper, we take advantage of the large box size of the Millennium Simulation combined with the semianalytic galaxy formation model GABE and the parameterized population binary star evolution model to examine how much effect the cosmic variance will introduce on the estimation of the merger rate density of BNS mergers. We find that for subbox sizes of 100 and 200 Mpc, the variance of merger rate density σ R /R at different redshifts is about 23%–35% and 13%–20%, respectively. On the one hand, as for the variance of the detection rate on BNS mergers with the current LIGO–Virgo–KAGRA (LVK) detector network, this value is very small at ≲10%, which indicates ignoring the cosmic variance is reasonable for estimating the merger rate density from current LVK observations. On the other hand, with next-generation gravitational wave detectors, it is possible to localize BNS mergers within subboxes possessing a length of 40 Mpc for a source redshift z s < 0.2. In such a small box, the cosmic variance of the merger rate density is significant, i.e., the value of σ R /R is about ∼55%. This hints that estimating the merger rate density of BNS in different sky areas may provide useful information on the cosmic variance.