Long and hollow glassy carbon microfibers were fabricated based on the pyrolysis of a natural product, human hair. The two fabrication steps of carbon microelectromechanical and carbon nanoelectromechanical systems, or C-MEMS and C-NEMS, are: (i) photolithography of a carbon-rich polymer precursor and (ii) pyrolysis of the patterned polymer precursor.