Motile cilia induce fluid movement through their rhythmic beating activity. In mammals, the transcription factor Foxj1 has been implicated in motile cilia formation. Here we show that a zebrafish Foxj1 homolog, foxj1a, is a target of Hedgehog signaling in the floor plate. Loss of Foxj1a compromises the assembly of motile cilia that decorate floor plate cells. Besides the floor plate, foxj1a is expressed in Kupffer's vesicle and pronephric ducts, where it also promotes ciliary differentiation. We show that Foxj1a activates a constellation of genes essential for motile cilia formation and function, and that its activity is sufficient for ectopic development of cilia that resemble motile cilia. We also document that a paralogous gene, foxj1b, is expressed in the otic vesicle and seems to regulate motile cilia formation in this tissue. Our findings identify a dedicated master regulatory role for Foxj1 in the transcriptional program that controls the production of motile cilia.