Some vaccines are intramuscular, which means you’re sticking the muscle itself with the needle. So the soreness in the muscle makes sense there.
Other vaccines contain ingredients designed to stimulate your immune system so that it’s more likely to detect and respond to the antigens (proteins, pieces of dead virus, or live virus depending on the vaccine) while they’re still intact in your blood. So they’ll cause general inflammation for a little while afterwards – a minor fever or cold-like illness is a common-ish side effect in cases where this reaction’s more vigorous than normal.
Latest Answers