atoms. He suggested that the properties of matter depended upon its atomic composition. In a chemical reaction groups of atoms originally joined together in one way became separated and then rejoined in new ways, forming matter with new properties.
Dalton believed that every atom of an element was identical in every way to every other atom of that element. So in theory you could count the number of atoms by measuring the masses of the atoms which make up a substance.
About the same time Joseph-Louis Gay-Lussac (in France) found that the masses of gases that reacted with each other showed no simple pattern. So example, eight grams of oxygen reacted with one gram of hydrogen to make water, and 14 grams of nitrogen reacted with three grams of hydrogen to make ammonia. He could make no sense of these numbers in terms of atoms.
But he also found that the volumes of those reacting gases did have a simple pattern when measured at equal temperatures and pressures. So the volume of hydrogen was exactly twice that of the volume of oxygen in the reaction to form water, while the volume of hydrogen was found to be exactly three times that of nitrogen in the reaction to form the gas ammonia. He believed that this pattern was caused by some as yet unknown fundamental property of matter.
Following this work Amedeo Avogadro (in Italy) suggested that this property could be explained by the rule "All gases at the same temperature, pressure, and volume will contain the same number of particles, which may or may not be single atoms". His idea was not well received, but Avogadro's pupil, Stanislao Cannizzaro, carried out further studies which showed that water molecules contain two atoms of hydrogen and one of oxygen and ammonia molecules three atoms of hydrogen and one of nitrogen.
These compositions are written as formulas in which the symbols for the elements represent single atoms. So water is H2O, the subscript 2 indicating two atoms of hydrogen and a subscript of 1 being understood for one atom of oxygen. For ammonia, the formula is NH3 : one atom of nitrogen and three atoms of hydrogen in each molecule.
About 50 years after the publication of Avogadro's ideas and largely through the efforts of Cannizzaro, Avogadro's hypothesis, or theory, as it is more commonly called today, was accepted by most scientists.