Work function
The work function is the minimum energy (usually measured in electron volts) needed to remove an electron from a solid to a point immediately outside the solid surface (or energy needed to move an electron from the Fermi energy level into vacuum). Here "immediately" means that the final electron position is far from the surface on the atomic scale but still close to the solid on the macroscopic scale. The work function is an important property of metals.

# Photoelectric work function
The work function is the minimum energy that must be given to an electron to liberate it from the surface of a particular metal. In the  photoelectric effect, electron excitation is achieved by absorption of a photon.  If the photon's energy greater than the metal's work function, photoelectric emission occurs and the electron is liberated from the metal. (Excess photon energy results in a liberated electron with non-zero kinetic energy.)
Photoelectric work function is
where h is the Planck's constant and f_0 is the minimum (threshold) frequency of the photon required to produce photoelectric emission.

# Thermionic work function
The work function is also important in the theory of thermionic emission.  Here the electron gains its energy from heat rather than photons.  According to the Richardson-Dushman equation
the emitted electron current density J (A/m2) is related to the absolute temperature T by the equation:
where  W is the work function of the metal, k is the Boltzmann constant and the proportionality constant A, known as Richardson's constant, is given by
where m and -e are the mass and charge of an electron, and h is Planck's constant.
Thermionic emission --- electrons escaping from the heated negatively-charged filament (hot cathode) --- is important in the operation of vacuum tubes.
Tungsten, the common choice for vacuum tube filaments, has a work function of approximately 4.5 eV; various
-xide coatings can substantially reduce this.

# Free Electron Gas Model
In the free electron model the valence electrons roam freely (zero force) inside the metal but find
a confining potential step U at the boundary of the metal.  In the system's ground state, states
with energy less than the Fermi Level are occupied, and states above the Fermi Level are not occupied. The energy
required to liberate an electron in the Fermi Level is the work function. If, as in the diagram right, we define
the Fermi Energy E_F from the bottom of the well the results reported in the Wiki page Fermi Energy
are applicable.  However, usually the Fermi Energy is referenced to energy zero: that of the lowest energy electron 
free of the metal.  In that case the Fermi Energy would have a negative value (i.e., the Fermi Level lies
below those of escaped electrons) E_F\approx -W (but see below).

# Work Function Trends
The thermionic work function depends on the orientation of the crystal and will tend to be smaller for metals with an open lattice, larger for metals in which the atoms are closely packed.  The range is about 1.56 eV.  It is somewhat higher on dense crystal faces than open ones.
The magnitude of the work function is usually about a half of the ionization energy of a free atom of the metal. 
For example, caesium has ionization energy 3.9 eV and work function 1.9 eV.

# Work Function and Surface Effect
Work function W of a metal is closely related to its Fermi energy  E_F \;  (defined
relative to the lowest energy free particle: zero in the above diagram) yet the two quantities are not exactly the same. This is due to the surface effect of a real-world solid: a real-world solid is not infinitely extended with electrons and ions repeatedly filling every primitive cell over all Bravais lattice sites. Neither can one simply take a set of Bravais lattice sites  \{R\} \;  inside the geometrical region V which the solid occupies and then fill undistorted charge distribution basis into all primitive cells of   \{R\} \; . Indeed, the charge distribution in those cells near the surface will be distorted significantly from that in a cell of an ideal infinite solid, resulting in an effective surface dipole distribution, or, sometimes both a surface dipole distribution and a surface charge distribution.
It can be proven that if we define work function as the minimum energy needed to remove an electron to a point immediately out of the solid, the effect of the surface charge distribution can be neglected, leaving only the surface dipole distribution. Let the potential energy difference across the surface due to effective surface dipole be  W_S \; . And let  E_F \;  be the Fermi energy calculated for the finite solid without considering surface distortion effect, when taking the convention that the potential at  r \rightarrow \infty \;  is zero. Then, the correct formula for work function is:
W = - E_F +W_S \;
Where  E_F \;  is negative, which means that electrons are bound in the solid.

# Applications
In electronics the work function is important for design of the metal-semiconductor junction in Schottky diodes and for design of vacuum tubes.

# Measurement
Many techniques have been developed based on different physical effects to measure the electronic work function of a sample. One may distinguish between two groups of experimental methods for work function measurements: absolute and relative.
Methods of the first group employ electron emission from the sample induced by photon absorption (photoemission), by high temperature (thermionic emission), due to an electric field (field emission), or using electron tunnelling.
All relative methods make use of the contact potential difference between the sample and a reference electrode. Experimentally, either an anode current of a diode is used or the displacement current between the sample and reference, created by an artificial change in the capacitance between the two, is measured (the Kelvin Probe method, Kelvin probe force microscope).

## Methods Based on Photoemission
Photoelectron emission spectroscopy (PES) is the general term for spectroscopic techniques based on the outer photoelectric effect. In the case of Ultraviolet Photoelectron Spectroscopy (UPS), the surface of a solid sample is irradiated with ultraviolet (UV) light and the kinetic energy of the emitted electrons is analysed. As UV light is electromagnetic radiation with an energy h f lower than 100 eV it is able to extract mainly valence electrons. Due to limitations of the escape depth of electrons in solids UPS is very surface sensitive, as the information depth is in the range of 2  20 monolayers (1-10nm). The resulting spectrum reflects the electronic structure of the sample providing information on the density of states, the occupation of states, and the work function.

## Methods Based on Thermionic Emission
The retarding diode method is one of the simplest and oldest method of measuring work functions. It is based on the thermionic emission of electrons from an emitter. The current density J of the electrons collected by the sample depends on the work function W of the sample and is given by the RichardsonDushman equation J = A T^2 e^{-W/kT}  where A, the Richardson constant, is a specific material constant. The current density increases rapidly with temperature and decreases exponentially with the work function. Changes of the work function can be easily determined by applying a retarding potential V between the sample and the electron emitter; W is replaced by W+eV in above equation. The difference in the retarding potential measured at constant current is equivalent to the work function change, assuming that the work function and the temperature of the emitter is constant.
One can use the RichardsonDushman equation directly to determine the work function by  temperature variation of the sample, as well. Rearranging the equation yields \ln(J/T^2) = \ln(A) - W/kT . The line produced by plotting \ln(J/T^2) vs. 1/T will have a slope of W/k allowing to determine the work function of the sample.

## Electron Work Functions of The Elements
Units: eV electron Volts
reference: CRC handbook on Chemistry and Physics. 
Note: Work function can change for crystaline elements based upon the orientation. For example Ag:4.26, Ag(110):4.64, Ag(110):4.52, Ag(111):4.74