The mechanical behavior of single-walled carbon nanotubes (SCWNTs) is one of the basic properties of the nanotube composite and nano machinery. The axial and bending buckling behavior of SWCNTs is systematically investigated by finite element mothod(FEM) in this paper. The results of molecular dynamics and FEM simulations are compared. Simulation results show that the axial buckling loads are dependent strongly on the diameter, and the buckling and postbuckling behavior of SWCNTs under bending depends strongly on the length and radii of the tube. With appropriate choice of Young's modulus and tube thickness, the FEM simulation provides some useful insight into the buckling mechanism of carbon nanotubes. The finite element method turns out to be a new, forthright and precise method for the simulation in solving large-scale nano-mechanics problems.