In physics, matter is everything that is constituted of elementary fermions. All gauge bosons (among which the photon), which mediate the four fundamental forces, are thus not considered matter, even though they certainly have energy and some also mass.
Matter thus consists of quarks and leptons. Quarks combine to form hadrons, primarily baryons and mesons, through the strong interaction and are actually thought to be always thus confined . Among the baryons are the proton and the neutron which further combine to form the nuclei of all elements of the periodic table. Usually these nuclei are surrounded by a cloud of electrons. A nucleus with as many electrons as protons, which is thus electrically neutral, is called an atom, otherwise it is an ion. Chemistry is the science that studies how nuclei and electrons combine to form compounds.
In bulk, matter can be in several different phases, according to particle density and energy density or alternatively pressure and temperature, such as Bose-Einstein condensated, superfluidic, liquid, fluidic, gaseous, solid and plasma. As circumstances change, matter may change from one phase to another. This phenomenon is called phase transition and is studied in the field of thermodynamics. In small quantities matter can exhibit properties which are entirely different from those of the bulk material.
Matter, in the sense of content, is also used in contrast to form.