Studies of charm and beauty production in ep collisions with a center-of-mass energy of 318 GeV are reported from the two HERA collaborations, H1 and ZEUS. The analyses make use of both the HERA-I data sample recorded between 1996 and 2000 and a sample from HERA-II, which started in 2003. The cross sections measured by both H1 and ZEUS experiments are compared with next-to-leading order QCD calculations. The measurement of the charm and beauty contributions to the proton structure function is also presented. The comparison to next-to-next-to-leading order (NNLO) calculations shows agreement within the errors.