We propose a new algorithm for the identification of the production flavor of neutral D mesons in the Belle II experiment. The algorithm exploits the correlation between the flavor of a reconstructed neutral D meson (signal D meson) and the electric charges of particles reconstructed in the rest of the e+e−→c ̄c event. These include those originating from the decay of the other charm hadron produced in the event, as well as those possibly produced in association with the signal D meson. We develop the algorithm using simulation and calibrate it in data using decay modes that identify the flavor of the decaying neutral D meson. We use a data sample of e+e− collisions, corresponding to 362 fb−1 of integrated luminosity, collected by Belle II at center-of-mass energies near the Υ(4S) mass. The effective tagging efficiency in data is (47.91±0.07(stat)±0.51(syst))%, independent of the neutral-D-meson decay mode. This charm flavor tagger will approximately double the effective sample size of many CP-violation and charm-mixing measurements that so far have exclusively relied on neutral D mesons originating from D*± decays. While developed for Belle II, the basic principles underlying the charm flavor tagger can be used in other experiments, including those at hadron colliders.