Exosomes are released by most cells to the extracellular environment and are involved in cell-to-cell communication. Exosomes contain specific repertoires of mRNAs, microRNAs (miRNAs) and other non-coding RNAs that can be functionally transferred to recipient cells. However, the mechanisms that control the specific loading of RNA species into exosomes remain unknown. Here we describe sequence motifs present in miRNAs that control their localization into exosomes. The protein heterogeneous nuclear ribonucleoprotein A2B1 (hnRNPA2B1) specifically binds exosomal miRNAs through the recognition of these motifs and controls their loading into exosomes. Moreover, hnRNPA2B1 in exosomes is sumoylated, and sumoylation controls the binding of hnRNPA2B1 to miRNAs. The loading of miRNAs into exosomes can be modulated by mutagenesis of the identified motifs or changes in hnRNPA2B1 expression levels. These findings identify hnRNPA2B1 as a key player in miRNA sorting into exosomes and provide potential tools for the packaging of selected regulatory RNAs into exosomes and their use in biomedical applications.