A W2 form is a year-end tax document that details your total earnings and withholdings for the entire tax year. This is different from a pay stub, which only shows a particular pay period. You need it to file tax returns on both the federal and state levels.