Walter Hunt invented and patented the safety pin in 1849. He sold the patent to W. R. Grace and Company for $400. Over the years, the company made millions from the invention.