First-principles calculations of cobalt with hcp and fcc structures are performed to investigate the compression mechanism of cobalt and to know a theoretical transition pressure from hcp to fcc phases under high-pressure condition. Here the Full-Potential Linearized Augmented Plane Wave (FP-LAPW) method is employed within the Generalized Gradient Approximation (GGA). Calculated transition pressure from hcp to fcc estimated by the free energy calculations is 128.3 GPa, which agrees well with experiment. The magnetic properties for both hcp and fcc phases at high pressures are also studied.