Fiber, an element component of textiles, biology, and devices, usually features the same composition and functions along its continuous length. Beyond traditional homogeneous structures, fiber has been expected to carry massive metastructure codes with asymmetric properties. Encoding fiber metastructures along the axial direction should reach the maximum code density to design promising axially encoded metamaterial fibers, yet this remains challenging. Here, we continuously program multiple precisely controlled axial sequencing codes in single fiber and prepared axially encoded metafibers by a microfluidic sequence spinning method. The delicate design in axial compositions breaks the fiber symmetry, encoding axially customized metastructures with tunable arrangement and wide material choice for metafibers. We initiated the axially encoded metafiber with asymmetric functions and localized properties to encompass mechanical, electrical, magnetic, and photothermal metafibers. The axially encoded metafiber extends the concept of metamaterials into fiber and fulfills the target demands of future smart textiles.