The one-dimensional infinite square well of length L is a model for a one-dimensional box with the potential energy:
It is a standard model-system in quantum mechanics for which the solution for a single particle is well known. Since the potential inside the box is uniform, this model is referred to as 1D uniform gas, even though the actual number density profile of the gas can have nodes and anti-nodes when the total number of particles is small.
The levels are labelled by a single quantum number n and the energies are given by:
where  is the zero-point energy (which can be chosen arbitrarily as a form of gauge fixing),  the mass of a single fermion, and  is the reduced Planck constant.
For N fermions with spin- in the box, no more than two particles can have the same energy, i.e., two particles can have the energy of , two other particles can have energy  and so forth. The two particles of the same energy have spin  (spin up) or − (spin down), leading to two states for each energy level. In the configuration for which the total energy is lowest (the ground state), all the energy levels up to n = N/2 are occupied and all the higher levels are empty.
Defining the reference for the Fermi energy to be , the Fermi energy is therefore given by
where  is the floor function evaluated at n = N/2.