Carbon's atomic number is 6, and its atomic mass is 12.0107 atomic mass units. The atomic number defines the number of protons located in the atom's nucleus, so carbon has six protons. Each element has its own atomic number.
Because the mass of the atom is made up of the number of protons and neutrons, carbon also has six neutrons in its nucleus. It has six electrons surrounding the nucleus, with two in the first energy level and four in the second energy level. Electrons do not contribute as much as neutrons and protons do to the mass of an atom.