This page lists the IDs of NPCs in Terraria. This includes monsters, critters, friendly NPCs (otherwise just referred to as 'NPCs'), bosses, and creature parts if the creature is composed by more than one.
Note that not every NPC has its own ID; these are differentiated via their names. They're listed here for completeness' sake. ID#'s 1 - 147 v1.1 Items, ID#'s 148 - 296 v1.2 Items.