The United States Flag Code says:
§4. Pledge of allegiance to the flag; manner of delivery
The Pledge of Allegiance to the Flag: “I pledge allegiance to the Flag of the United States of America, and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all.” should be rendered by standing at attention facing the flag with the right hand over the heart. When not in uniform, men should remove any non-religious headdress with their right hand and hold it at the left shoulder, the hand being over the heart. Persons in uniform should remain silent, face the flag, and render the military salute.