A nickel hexacyanoferrate (NiHCF)/carbon composite is prepared to realize reduced structure vacancies and enhanced conductivity simultaneously.