The problem with pencils
Pencils can write in microgravity and were used on early missions, but small graphite fragments can break off and float. The material could reach sensitive instruments or create risks for the crew.
The Space Pen
Fisher Pen Company developed a pen with a pressurised cartridge that feeds ink without relying on gravity. NASA tested it and purchased it for Apollo missions. The story that NASA spent millions inventing it while cosmonauts simply used pencils does not accurately describe these events.
Writing aboard the ISS
NASA reports that numerous Space Pens are aboard the station. The choice depends on the task: the question is not only whether an instrument can write, but also how it behaves inside a spacecraft.