And Joab gave the sum of the numbering of the people to David. In all Israel there were 1,100,000 men who drew the sword, and in Judah 470,000 who drew the sword. (1 Chronicles 21:5)
And Joab gave the sum of the numbering of the people to the king: in Israel there were 800,000 valiant men who drew the sword, and the men of Judah were 500,000. (2 Samuel 24:9)
Most likely, the number of men of Israel given in 2 Samuel did not include some of those counted in 1 Chronicles. For example, there may have been 300,000 men in a reserves force who are included in 1 Chronicles 21:5 but not in 2 Samuel 24:9. Note that 2 Samuel calls them “valiant men” indicating these may have been battle-seasoned troops.
The difference in the numbers for Judah can be explained similarly. In 1 Chronicles 21:6, it is said that Joab did not include Levi or Benjamin in the numbering, but perhaps these were added in to the record in 2 Samuel 24.