Heart formation is a complex morphogenetic process, and perturbations in cardiac morphogenesis lead to congenital heart disease. NKX2-5 is a key causative gene associated with cardiac birth defects, presumably because of its essential roles during the early steps of cardiogenesis. Previous studies in model organisms implicate NKX2-5 homologs in numerous processes, including cardiac progenitor specification, progenitor proliferation, and chamber morphogenesis. By inhibiting function of the zebrafish NKX2-5 homologs, nkx2.5 and nkx2.7, we show that nkx genes are essential to establish the original dimensions of the linear heart tube. The nkx-deficient heart tube fails to elongate normally: its ventricular portion is atypically short and wide, and its atrial portion is disorganized and sprawling. This atrial phenotype is associated with a surplus of atrial cardiomyocytes, whereas ventricular cell number is normal at this stage. However, ventricular cell number is decreased in nkx-deficient embryos later in development, when cardiac chambers are emerging. Thus, we conclude that nkx genes regulate heart tube extension and exert differential effects on ventricular and atrial cell number. Our data suggest that morphogenetic errors could originate during early stages of heart tube assembly in patients with NKX2-5 mutations.