A hair cosmetic containing Components (A) and (B):(A) a cationic polymer having a charge density of 5.0 to 7.0 meq/g; and(B) an anionic polymer comprising 80% by mass or more and 100% by mass or less of a constitutional unit represented by Formula (1) and having a weight-average molecular weight of 4,000 or more and 80,000 or less,where R1 represents a hydrogen atom or a carboxy group; and R2 represents a hydrogen atom or a methyl group.