Take a sip of water. Every drop holds more than a billion billion tiny water molecules. Each one is made of three atoms: two hydrogen atoms and one oxygen atom, holding on to each other tightly.

But atoms have no hands and no glue. So how do they hold on? And why do they join at all? Let’s find out, step by step.

What does an atom look like from the outside?

Every atom has a tiny nucleus in the middle, with a plus charge. Around it move much lighter electrons, each with a minus charge. Plus pulls on minus, and that pull keeps the electrons near the nucleus.

The electrons sit in layers around the nucleus, a bit like the layers of an onion. These layers are called electron shells. The first shell has room for only 2 electrons. The shells further out have room for more.

The last shell with electrons in it is the outer shell. Its electrons are the ones that do all the joining. For hydrogen and helium, the outer shell is full with 2 electrons. For carbon, oxygen, chlorine and many other atoms, it is full with 8.

Why do atoms join at all?

A few kinds of atoms already have a full outer shell. Helium, neon and argon are like this. They are called noble gases, and they almost never join with anything. A full outer shell makes an atom settled and calm.

Most atoms have gaps in their outer shell. Oxygen, for example, has 6 electrons there: 2 short of 8. Hydrogen has 1: 1 short of 2.

Atoms like these can fill their shells by teaming up. They share electrons with a neighbour, or they hand electrons over.

When atoms join up like this, they end up more settled than they were apart. Scientists say the joined atoms have less energy. The spare energy escapes, often as heat. That is why pulling joined atoms apart always takes energy.

The hold between two joined atoms is called a chemical bond.

Go deeper: The full-shell rule and where it breaks for grown-ups and the extra curious

Atoms don’t want anything. What decides is energy: atoms join whenever the joined arrangement has less energy than the separate atoms. For carbon, nitrogen, oxygen, the halogens and their neighbours, the arrangements with the least energy are nearly always the ones in which every atom ends up with 8 outer electrons, like a noble gas. Hydrogen ends up with 2, like helium. Chemists call this the octet rule. It is a counting shortcut, not a law of nature, and it has exceptions:

  • In boron trifluoride (BF₃), boron is surrounded by only 6 electrons.
  • In sulfur hexafluoride (SF₆), sulfur has 12 electrons around it; in PCl₅, phosphorus has 10.
  • Nitrogen monoxide (NO) has an odd number of electrons, so not every atom can have 8.
  • The metals in the middle of the periodic table, such as iron and copper, follow other patterns.
  • The oxygen molecule O₂ is magnetic: liquid oxygen clings to a strong magnet. The simple shared-pair picture cannot explain that. A fuller theory (molecular orbitals) shows that two of its electrons are unpaired.
  • Even noble gases are not completely unreactive. In 1962, Neil Bartlett made the first compound of xenon, and xenon difluoride (XeF₂) followed the same year. Helium and neon still form no stable compounds under ordinary conditions.

How can atoms share electrons?

Let’s start with the smallest atom: hydrogen. It has 1 electron, but its shell has room for 2.

Bring two hydrogen atoms close together, and something neat happens. Their electron clouds overlap, and the two electrons form a pair that belongs to both atoms. Now each atom can count 2 electrons: a full shell!

The shared pair sits between the two nuclei, and both nuclei pull on it. So both atoms are pulled towards the same pair in the middle, and that holds them together. A bond made by sharing electrons is called a covalent bond. The two joined atoms make a hydrogen molecule, written H₂.

Two hydrogen atoms share their electrons On the left, two separate hydrogen atoms. Each has a nucleus with a shell around it and one electron in the shell. An arrow points to the right, where the two atoms have joined into a hydrogen molecule, H₂. Their shells overlap, and both electrons sit together in the overlap as a shared pair. + 2 hydrogen atoms shared pair H₂ molecule nucleus electron
Each hydrogen atom brings one electron. Shared between the two atoms, the pair gives both of them a full shell of 2, and it holds them together.
Go deeper: What really holds a shared pair for grown-ups and the extra curious

A covalent bond is a quantum effect. When two hydrogen atoms come close, their electron clouds (orbitals) merge into one cloud that surrounds both nuclei. The two electrons in it spend much of their time between the nuclei, where both nuclei attract them. This lowers the energy, until the nuclei are about 0.074 nanometres apart. Any closer, and the two nuclei push each other away too strongly.

Splitting the bond again costs about 436 kilojoules per mole (kJ/mol). That is the energy needed to split 2 grams of hydrogen gas into single atoms. A mole is a fixed number of particles: 6.022 × 10²³.

The rings in the pictures are only a handy way to draw shells. Real electrons form fuzzy clouds, as the atom article explains.

How many bonds can an atom make?

Oxygen has 6 electrons in its outer shell. It needs 2 more to reach 8, so it shares with two hydrogen atoms, one pair with each. That makes water: H₂O.

Carbon has 4 outer electrons and needs 4 more. It shares with four hydrogen atoms, and that makes methane: CH₄. Methane is the main part of natural gas, which burns on many kitchen stoves.

So you can work out how many bonds an atom usually makes. Count how many electrons are missing from its outer shell:

AtomOuter electronsMissingBonds it usually makes
hydrogen (H)111
oxygen (O)622
nitrogen (N)533
carbon (C)444

What are double and triple bonds?

Atoms can share more than one pair of electrons. Two oxygen atoms each need 2 more electrons, so they share two pairs. This is a double bond. It holds together the oxygen in the air you breathe: O₂.

Two nitrogen atoms each need 3 more. They share three pairs, which makes a triple bond. That is nitrogen gas: N₂.

Chemists draw each shared pair as a short line: H–H, O=O and N≡N.

Single, double and triple bonds Three molecules, one per row. Hydrogen, H₂: two hydrogen atoms share one pair of electrons, a single bond, drawn H–H. Oxygen, O₂: two oxygen atoms share two pairs, a double bond, drawn O=O; each oxygen atom also keeps two pairs of its own. Nitrogen, N₂: two nitrogen atoms share three pairs, a triple bond, drawn N≡N; each nitrogen atom also keeps one pair of its own. H H H₂ H–H single bond 1 shared pair O O O₂ O=O double bond 2 shared pairs N N N₂ N≡N triple bond 3 shared pairs
Each line stands for one shared pair of electrons. Count the electrons around each atom: hydrogen ends up with 2, and oxygen and nitrogen with 8.

A triple bond is very hard to break. That is why nitrogen hardly ever reacts with anything, even though air is about 78% nitrogen. You breathe it in and out all day, and it comes back out unchanged. Splitting it takes something special, like a flash of lightning, some bacteria in the soil or a big factory that makes fertiliser.

Go deeper: How strong are bonds? for grown-ups and the extra curious

Chemists measure bond strength as the energy needed to break one mole of bonds (6.022 × 10²³ of them). Typical values at room temperature:

BondEnergy to break it
H–H in hydrogen, H₂436 kJ/mol
O=O in oxygen, O₂498 kJ/mol
N≡N in nitrogen, N₂945 kJ/mol
C–H, averageabout 415 kJ/mol
O–H, averageabout 464 kJ/mol
C–C, C=C, C≡C, averagesabout 345, 611 and 837 kJ/mol

For carbon, a double bond is stronger than a single bond, but not twice as strong. The second and third shared pairs sit beside the line joining the atoms (chemists call them π bonds), where they hold less tightly.

Nitrogen’s triple bond is one of the strongest bonds between two atoms. Factories that turn air’s nitrogen into fertiliser (the Haber–Bosch process) need an iron catalyst, several hundred degrees Celsius and very high pressure. Soil bacteria do the same job at room temperature, with an enzyme.

What happens when one atom gives an electron away?

Sharing is not the only way to fill a shell. Sometimes one atom hands an electron over to another.

Sodium is a soft, shiny metal. It has just 1 electron in its outer shell. Chlorine is a poisonous yellow-green gas. It has 7 electrons in its outer shell, 1 short of 8.

Chlorine pulls on electrons much harder than sodium does. When the two meet, sodium’s lone outer electron jumps over to chlorine. Now chlorine has 8 in its outer shell. Sodium has lost its outer electron, so the full shell of 8 underneath becomes its outer shell.

But now the charges no longer balance. Sodium has one more proton than electrons, so it has a plus charge. Chlorine has one extra electron, so it has a minus charge.

Atoms with a charge are called ions. Plus and minus pull hard on each other, and this pull is an ionic bond.

The dangerous metal and the poisonous gas have become something you sprinkle on your food: table salt. Its chemical name is sodium chloride, written NaCl. The chlorine ion is called a chloride ion.

Salt is not made of little pairs, though. Each ion pulls on all the ions around it, so they stack up in a neat pattern in every direction. Every sodium ion has six chloride ions around it, and every chloride ion has six sodium ions.

A huge, orderly stack like this is called a crystal. Look at salt through a magnifying glass: many grains are tiny cubes!

Sodium hands an electron to chlorine, and the ions build a salt crystal Top: a sodium atom with electron shells holding 2, 8 and 1 electrons, and a chlorine atom with shells holding 2, 8 and 7. An arrow shows sodium’s single outer electron jumping into the free place in chlorine’s outer shell. Middle: afterwards, sodium has shells of 2 and 8 and a plus charge, and chlorine has shells of 2, 8 and 8 and a minus charge. The plus and minus ions pull on each other. Bottom: one layer of a salt crystal, a checkerboard of small plus sodium ions and bigger minus chloride ions. 1 electron jumps sodium atom 2, 8, 1 chlorine atom 2, 8, 7 pull sodium ion Na⁺ chloride ion Cl⁻ one layer of a salt crystal
Sodium’s single outer electron jumps to chlorine. Both end up with full outer shells, and with opposite charges that pull them together. In salt, the ions stack up into a crystal.
Go deeper: Why the handover pays off for grown-ups and the extra curious

Surprisingly, the handover on its own costs energy. Pulling the outer electron off a sodium atom takes about 496 kJ/mol. Chlorine gives back only about 349 kJ/mol when it takes the electron. What pays for the difference is the pull between the ions. When Na⁺ and Cl⁻ ions pack together into a crystal, they release more than five times as much energy as the handover cost.

That strong pull between ions is also why salt is so hard to melt: it melts only at 801 °C. Solid salt does not conduct electricity, because its ions are locked in place. Dissolved in water, the ions can move, and salty water does conduct.

How do metals hold together?

Metals hold together in a third way. A metal atom has only a few electrons in its outer shell, and it holds them loosely.

In a piece of metal, every atom lets its outer electrons go. The freed electrons wander between all the atoms, like a sea around islands.

The atoms left behind have a plus charge. They sit in neat rows, and the sea of minus electrons holds them all together. This is called a metallic bond.

Metal ions in a sea of electrons A piece of metal, seen up close. Metal ions with a plus charge sit in three neat rows. Between them, many free electrons wander in all directions, like a sea that fills every gap and holds the ions together. a piece of metal, up close metal ion free electron
In a metal, the atoms give up their outer electrons. The plus metal ions sit in rows in a sea of free electrons, which holds them together.

The electron sea explains a lot about metals:

  • The free electrons can flow through the metal as an electric current. That is why metals are good conductors.
  • You can bend or hammer most metals without breaking them. The rows of atoms slide past each other, and the sea keeps holding them.
  • The electron sea reflects light, which makes metals shiny.

Build molecules yourself

Now you know the three ways atoms hold on to each other. Try two of them in the lab below: join atoms by sharing pairs of electrons, or let sodium hand one over, and see how many molecules you can discover.

Build a molecule

Pick two atoms to join them. Pick the second one again for a double bond. Pick a bond to loosen it. Keys: Tab to move, Enter to pick, Delete to remove, Escape to let go.

Oδ−Hδ+Hδ+CHHHHWater

Water H₂O

Shape: bent, like a V

Polar: one end is slightly negative (δ−), the other slightly positive (δ+).

Oxygen pulls the shared electrons closer, and the molecule is bent (104.5°), so its oxygen end is slightly negative. That helps water dissolve so many things.

Water, H₂O, complete. Free: 1 carbon atom, 4 hydrogen atoms.

Nonmetals
Metals

Quests 1 of 8 done

  • Hydrogen gas, H₂: join two hydrogen atoms
  • Water, H₂O, done
  • Carbon dioxide, CO₂, with two double bonds
  • Methane, CH₄
  • Ammonia, NH₃
  • Nitrogen gas, N₂, with a triple bond
  • Table salt, NaCl: an ionic bond
  • Sodium hydroxide, NaOH: ionic and covalent bonds at once

Your collection Discovered: 1 of 35

Pick a name to read about it again.

Pick an atom, then another, to join them. Pick the second atom again for a double or triple bond. When no atom has a free bond left, the molecule lights up with its name.

What shape is a molecule?

Many molecules are not flat, like the pictures on a page. Every molecule has a shape, and the electrons decide it.

Electron pairs around an atom push each other away, because minus pushes minus. So they spread out as far apart as they can.

  • Carbon dioxide (CO₂) is straight: O=C=O. Carbon has two groups of electrons around it, its two double bonds, and they point in opposite directions.
  • Methane (CH₄) is a triangular pyramid. The four hydrogen atoms sit at its corners, and the carbon atom sits in the middle.
  • Water (H₂O) is bent, like a wide letter V. Oxygen shares two pairs of electrons, but it also keeps two pairs of its own. These four pairs point roughly to the corners of a pyramid. So the two hydrogen atoms end up at an angle of about 104.5°.
The shapes of carbon dioxide, water and methane Three molecules, one per row. Carbon dioxide, CO₂: an oxygen atom, a carbon atom and another oxygen atom in a straight line, joined by double bonds. Water, H₂O: an oxygen atom with two hydrogen atoms below it, bent at an angle of 104.5°; above the oxygen sit its two unshared pairs of electrons. Methane, CH₄: a carbon atom in the middle of a triangular pyramid, with a hydrogen atom at each of its four corners. O C O CO₂ carbon dioxide straight O HH104.5° H₂O water bent ●● unshared pairs C HHHHCH₄ methane triangular pyramid
Carbon dioxide is straight, water is bent and methane is a triangular pyramid. Water’s two unshared pairs of electrons push its hydrogen atoms down.
Go deeper: Shapes from pushing pairs (VSEPR) for grown-ups and the extra curious

This way of predicting shapes is called VSEPR: valence-shell electron-pair repulsion. Count the groups of electrons around the central atom. Each bond counts as one group, even a double or triple bond. So does each lone pair, a pair that belongs to one atom only.

  • Two groups point in opposite directions, 180° apart: carbon dioxide.
  • Four groups point to the corners of a regular triangular pyramid (a tetrahedron), 109.5° apart: methane.
  • Lone pairs push harder than shared pairs and squeeze the bonds together. Ammonia (NH₃), with one lone pair, is a low pyramid, like a tripod, with angles of about 107°. Water, with two lone pairs, closes up to 104.5°.

VSEPR is a rule of thumb. It works well for small molecules of nonmetals, and less well for the metals in the middle of the periodic table.

What happens when sharing is uneven?

When two different atoms share electrons, they don’t always share fairly. Oxygen pulls on shared electrons much harder than hydrogen does. So in water, the shared electrons spend more time near the oxygen atom.

This gives the oxygen side of the molecule a slight minus charge, and the hydrogen side a slight plus charge. Chemists mark them δ− and δ+ (δ is the Greek letter delta). Because water is bent, one side of the molecule is a little negative and the other a little positive. A molecule like this is called polar.

Water is a polar molecule A large water molecule: an oxygen atom at the top and two hydrogen atoms below it, 104.5° apart. The shared electrons in each bond sit closer to the oxygen than to the hydrogen. A bluish haze around the oxygen marks its slightly negative side, δ−. An orange haze around each hydrogen marks the slightly positive side, δ+. 104.5° O HHδ− slightly minus δ+δ+slightly plusslightly plusoxygen pulls the shared electrons closer
Oxygen pulls the shared electrons towards itself. The oxygen side of the molecule becomes slightly negative (δ−), and the hydrogen side slightly positive (δ+).

Carbon dioxide’s bonds are uneven too. But the molecule is straight, so the two pulls point in opposite directions and cancel out. Carbon dioxide is not polar.

Being polar makes water very good at dissolving things. Drop salt into water, and the slightly negative oxygen sides of water molecules tug on the plus sodium ions. The slightly positive hydrogen sides tug on the minus chloride ions. One by one, the ions are pulled out of the crystal, and the salt disappears.

Oil is not polar, so water has nothing to tug on. Water molecules stick to each other instead and push the oil aside. That is why oil and water don’t mix.

Go deeper: Measuring the pull: electronegativity for grown-ups and the extra curious

How hard an atom pulls on shared electrons is called its electronegativity. Linus Pauling introduced the idea in 1932. On his scale, sodium has 0.93, hydrogen 2.20, carbon 2.55, chlorine 3.16 and oxygen 3.44. Fluorine has the highest value of all: 3.98.

The bigger the difference between two atoms, the more uneven the sharing. School textbooks often use a rough rule. A difference below 0.4 gives a nonpolar covalent bond, 0.4 to 1.7 a polar covalent bond, and more than 1.7 a mainly ionic bond. Nature has no sharp borders here, though. Bonds form a smooth scale, from fair sharing (H–H) to an almost complete handover (sodium chloride).

Water’s lopsidedness can be measured as its dipole moment, about 1.85 debye. Carbon dioxide’s is zero, because its two polar bonds point in opposite directions.

Why does ice float?

Polar water molecules also stick to each other. The slightly positive hydrogen of one molecule is pulled towards the slightly negative oxygen of the next. This gentle pull between molecules is called a hydrogen bond. It is about twenty times weaker than the bonds inside a water molecule.

In liquid water, the molecules tumble around, and hydrogen bonds keep breaking and forming again. But when water freezes, every molecule locks into hydrogen bonds with four neighbours. Together they build a pattern of six-sided rings with gaps in the middle.

Water molecules in liquid water and in ice Two boxes of the same size. Left, liquid water: the molecules are jumbled and crowded close together, with a few hydrogen bonds between them. Right, ice: hydrogen bonds hold the molecules in a regular pattern of six-sided rings, with an empty gap in the middle of each ring, so fewer molecules fit in the same box. liquid water ice jumbled and crowded rings with gaps water molecule hydrogen bond
In liquid water, the molecules crowd close together. In ice, hydrogen bonds hold them in open six-sided rings, which take up more space.

These gaps make ice take up about a tenth more space than the same water did as a liquid. So a cup of ice weighs less than a cup of water, and ice floats. That is why lakes freeze from the top down, and fish can live under the ice all winter.

Go deeper: Forces between molecules for grown-ups and the extra curious

A hydrogen bond in water takes about 20 kJ/mol to break. An O–H bond inside the molecule takes about 460 kJ/mol. In ice, each molecule is hydrogen-bonded to four neighbours, which builds open, six-sided channels. Ice has a density of about 0.917 g/cm³, while liquid water near 0 °C has almost 1.000 g/cm³: about 9% more. Liquid water is densest at about 4 °C.

Hydrogen bonds also explain why water boils so late. Hydrogen sulfide (H₂S) is bent like water and has heavier molecules, yet it boils at about −60 °C. Water boils only at 100 °C (read more about the boiling point).

All molecules, even nonpolar ones, attract each other a little through van der Waals forces. The electron clouds of neighbouring molecules flicker in step and pull on each other. Each pull is tiny, but there are many of them. They hold liquid nitrogen together, and they let geckos cling to walls with millions of microscopic hairs on their toes.

Does making a bond give out energy?

Yes! Making a bond gives out energy, and breaking a bond takes energy.

Then how can a fire give out heat? A fire breaks bonds in the fuel and in the oxygen, and that costs energy.

But then the atoms join again in new ways, making carbon dioxide and water. Those new bonds are stronger than the old ones, so more energy comes out than went in. The extra energy is the heat and light of the flame.

Breaking old bonds and making new ones is what happens in every chemical reaction. The energy is never lost or made from nothing: it only changes form. That is the rule of conservation of energy.

Go deeper: A common mix-up about energy in bonds for grown-ups and the extra curious

You may read that energy is “stored in bonds” and “released when they break”. That is backwards: breaking a bond always costs energy. A fuel’s energy belongs to the whole arrangement. Methane and oxygen together hold more energy than the carbon dioxide and water they turn into.

Burning 16 grams of methane (one mole) gives out about 890 kJ, if the water it makes ends up as a liquid. That is enough to bring about 2½ litres of cold water to the boil. The article about chemical reactions shows how to estimate this from bond energies.

Check yourself

Why does the nitrogen in the air hardly ever react with anything?

Show the answer

Its two atoms are held together by a very strong triple bond — The two nitrogen atoms share three pairs of electrons. This triple bond is very hard to break, so nitrogen hardly reacts, even though it makes up about 78% of the air.

Check yourself

Why does ice float on water?

Show the answer

Hydrogen bonds hold its molecules in an open pattern with gaps — In ice, hydrogen bonds lock the water molecules into open six-sided rings. The gaps make ice take up more space, so a cup of ice weighs less than a cup of water. Even clear ice with no bubbles floats.