HP's market share of worldwide shipments was 16.1%, compared with Dell's market share of 15.7%.
HP shipped 6.17 million units, with Dell trailing closely behind with 6.05 million units. IBM came third with 2.25 million units, followed by Fujitsu Siemens Computers with 1.66 million units. NEC was fifth with 1.26 million units.
"HP is the stronger company among consumers, and consumers performed stronger than expected, especially in the US," said Roger Kay, director of client computing at IDC.
US consumers bought 6.6% more PCs this year during the fourth quarter than they did in the same period last year. Growth in unit shipments was stronger than expected in the US, partly because of the aggressive pricing strategies from HP and Dell, IDC said.
HP's stronger international presence also contributed to its ranking in the fourth quarter. PC shipments in the Asia-Pacific region (excluding Japan) posted a strong growth, fuelled by the continued growth in China. However, Europe remained weak with little improvement in sales to consumers.
Dell maintained its lead for the full year, shipping 20.7 million units worldwide, compared with HP's 18.4 million units. The HP numbers include shipments of Compaq PCs after the acquisition closed.
Overall shipments for the year were up 1.5%, compared with a fall of 4.2% in 2001.
Gateway failed to grow its shipments from the third quarter of 2002 to the fourth quarter, despite strong PC sales among consumers. Gateway came third in US shipments, with 700,000 units shipped in the fourth quarter.