A hallmark of RNA silencing is a class of approximately 22-nucleotide RNAs that are processed from double-stranded RNA precursors by Dicer. Accurate processing by Dicer is crucial for the functionality of microRNAs (miRNAs). The current model posits that Dicer selects cleavage sites by measuring a set distance from the 3′ overhang of the double-stranded RNA terminus. Here we report that human Dicer anchors not only the 3′ end but also the 5′ end, with the cleavage site determined mainly by the distance (∼22 nucleotides) from the 5′ end (5′ counting rule). This cleavage requires a 5′-terminal phosphate group. Further, we identify a novel basic motif (5′ pocket) in human Dicer that recognizes the 5′-phosphorylated end. The 5′ counting rule and the 5′ anchoring residues are conserved in Drosophila Dicer-1, but not in Giardia Dicer. Mutations in the 5′ pocket reduce processing efficiency and alter cleavage sites in vitro. Consistently, miRNA biogenesis is perturbed in vivo when Dicer-null embryonic stem cells are replenished with the 5′-pocket mutant. Thus, 5′-end recognition by Dicer is important for precise and effective biogenesis of miRNAs. Insights from this study should also afford practical benefits to the design of small hairpin RNAs. The microRNAs (miRNAs) prominently involved in gene silencing in plants and animals are typically about 22 nucleotides long. They are produced by sequential cleavage of a longer precursor by two ribonucleases, one of which is Dicer. It was thought that Dicer uses a 'ruler' mechanism, measuring the length from the 3′ end of the double-stranded RNA to make the cleavage that releases the functional 22-nucleotide RNA. Here, V. Narry Kim and colleagues show that Dicer contains a pocket to bind the precursor's phosphorylated 5′ end, and that cleavage is in fact measured by counting the distance from this end. Mutation of the 5′ pocket in Dicer affects miRNA processing in vivo, indicating the importance of this counting mechanism.