They didn’t. The “million-dollar space pen” story is an urban legend that just refuses to die.

Pencils aren’t “just as good” in zero-G; in fact, they’re absolutely terrible. Loose graphite can short out electronics and wood shavings are a fire hazard in 100% oxygen environments.
NASA attempted developing pens that would work in zero-G but gave it up when (ironically considering the persistence of this rumor), it appeared that it would be too expensive. Various approaches such as felt pens and grease boards were experimented with but were judged unsatisfactory.
Then Paul Fisher, owner of the eponymous pen company, with the company’s own money developed a pressurized pen cartridge that would work anywhere, including underwater and in space.
He gave a few to NASA to evaluate, and when the astronauts were pleased with the results, offered to sell them to the Agency at cost, reckoning that the publicity and sales to the public that resulted would be worth it.
Fisher sold the pens to NASA for the current equivalent of about $13 apiece, so not cheap but hardly the boondoggle the story makes it out to be. And the company continues to market the Space Pen to this day.
Incidentally, the second part of the story – “the Russians just used a pencil” – isn’t true either. Pencils were just as bad for Soviet space ships as they were for American. The Soviets bought and then copied Fisher space pens for their own program’s use.


That tired old joke never gets old and tired. The version I like better is, “NASA spent millions developing a pen that works in space, and the Russians just used pencils!”
Ha ha ha. Very funny. 🙄
The Space Pen was developed by Fisher Space Pen, at no development cost to NASA, in exchange for the exclusive right to market the pens to consumers.
NASA purchased the pens for the same price as everyone else. They didn’t cost “millions.” See Emil’s comment below.
And pencils are messy. The little bits of graphite dust would float around getting into everything. It’s conductive, and it could have shorted out something electrcal, something important. That’s “probably why” the Russians never made it to the Moon. That’s a joke. Ha ha ha. 😐
OP: “Why did NASA spend millions developing a pen that would work in space when a pencil is just as good?”