The iron storage protein, apoferritin, has a cavity in which iron is oxidized and stored as a hydrated oxide core. The size of the core is about 7 nm in diameter and is regulated by the cavity size. The cavity can be utilized as a nanoreactor to grow inorganic crystals. We incubated apoferritin in nickel or chromium salt solutions to fabricate hydroxide nanoparticles in the cavity. By using a solution containing dissolved carbon dioxide and by precisely controlling the pH, we succeeded in fabricating nickel and chromium cores. During the hydroxylation process of nickel ions a large portion of the apoferritin precipitated through bulk precipitation of nickel hydroxide. Bulk precipitation was suppressed by adding ammonium ions. However, even in the presence of ammonium ions the core did not form using a degassed solution. We concluded that carbonate ions were indispensable for core formation and that the ammonium ions prevented precipitation in the bulk solution. The optimized condition for nickel core formation was 0.3 mg/mL horse spleen apoferritin and 5 mM ammonium nickel sulfate in water containing dissolved carbon dioxide. The pH was maintained at 8.65 using two buffer solutions: 150 mM HEPES (pH 7.5) and 195 mM CAPSO (pH 9.5) with 20 mM ammonium at 23 degrees C. The pH had not changed after 48 h. After 24 h of incubation, all apoferritins remained in the supernatant and all of them had cores. Recombinant L-ferritin showed less precipitation even above a pH of 8.65. A chromium core was formed under the following conditions: 0.1 mg/mL apoferritin, 1 mM ammonium chromium sulfate, 100 mM HEPES (pH 7.5) with a solution containing dissolved carbon dioxide. About 80% of the supernatant apoferritin (0.07 mg/mL) formed a core. In nickel and chromium core formation, carbonate ions would play an important role in accelerating the hydroxylation in the apoferritin cavity compared to the bulk solution outside.