Guinea pigs are a bit of a puzzle, terminology-wise. They’re rodents, not pigs. They’re not from Guinea, either; they were first found in South America — or rather, their ancestors were; the guinea pigs that are now pets have been domesticated enough that they differ quite a bit from the wild variety. Not quite to the extent that dogs differ from wolves, but getting there.
Guinea pigs were named (in English, at least) in the 1600s when Europeans arrived in South America. Like practically all newly-discovered species, some were brought back to Europe. Because they were small, didn’t mind living in small enclosures, and aren’t fussy about what they eat, they arrived alive and probably in pretty good health. They were quickly adopted as pets, and in fact had even been adopted by some of the sailors en route.
Although there’s a theory that the name “guinea pig” might have been based on the “guinea hog” — which really is a pig — the idea doesn’t pan out because a little research shows that ‘guinea pig” was used at least a century before “guinea hog.” Guinea hogs, by the way, don’t come from Guinea either. And neither do guinea cattle. But both the hogs and the cattle are small breeds, so it’s possible that those names are based on “guinea pig” instead of the other way around.
Guinea pigs seem to have been taken on ships pretty regularly, and they acquired a number of names. The names generally include a location or origin that’s always wrong. The French name translates to “Indian pig” and the Dutch to “Spanish rat.” But the Spanish term means “little rabbit of the Indies”. There are two Chinese names: “Netherlands pig” and “India mouse.” The German term, though, is “little sea pig,” which seems like a whole new category of wrong. Guinea pigs don’t seem to ever have had a name anything close to “cute little rodent from the Andes mountains,” which is what they really are.
As for the phrase “guinea pig” meaning an experimental subject (“I tried New Coke, so I was a guinea pig in the cola war”), that makes a bit more sense. The animals can suffer from some of the same diseases as humans — tuberculosis, for one — and they were used in tests as early as the 1880s. In fact, Louis Pasteur used guinea pigs in his research into rabies in the 1890s.
It was George Bernard Shaw’s idea, in 1913, to apply “guinea pig” to people. It was already generally known that guinea pigs were used as test subjects, and the term caught on immediately. But what far fewer people knew was that during the 1700s and 1800s, “guinea pig” had already been used to describe a category of person. It shows up, for example, in a 1767 novel: “He sent his nephew, at the age of fourteen, on a voyage as a Guinea-pig.” Today we might think that meant the nephew was sent as an experiment, but not so. In those days a “guinea pig” was a sailor crewing a ship bound for the East Indies.