Particle in a Box Calculator – Energy Levels n²h²/(8mL²)

Use this free Particle in a Box Calculator to find the quantised energy levels of a particle trapped in a one-dimensional box of width L. Squeeze a particle into a tiny space and its energy can only take the values En = n²h² / (8mL²) — the smaller the box, the bigger the energies.

The particle in a box is quantum mechanics stripped to its skeleton: one particle, two impenetrable walls, nothing else. It is also the system where quantisation stops being mysterious and becomes inevitable geometry. A particle trapped between walls is a wave confined between boundaries, and — like a guitar string that can only vibrate in whole numbers of half-wavelengths — it can only exist in standing-wave patterns that fit. Each fitting pattern has its own wavelength, hence its own momentum, hence its own energy: En = n²h²/(8mL²). No fitting pattern, no particle. The discreteness of quantum energy levels, everywhere else a postulate to swallow, is here just the arithmetic of what fits in a box.

The formula's two scalings run the nanoscale world. Energy grows with n², so the levels spread further apart as they climb — the opposite temperament from the hydrogen atom's crowding ladder, and different again from the harmonic oscillator's even rungs. And energy falls with 1/L², which is the leverage that makes nanotechnology possible: halve the box and every energy quadruples. An electron in a 10 nm box has millivolt-scale levels and behaves almost classically; squeeze it into 1 nm and the levels leap to electronvolts — the energies of visible light — which is why nanometre-sized specks of semiconductor glow in colours set by their size. This calculator evaluates the levels for any particle, any box, any n.

Particle in a Box Calculator — formula and diagram

Choose the particle carefully, because mass is the third lever: E ∝ 1/m. The same 1 nm box that gives an electron 0.376 eV gives a proton — 1,836 times heavier — a ground level of only 0.0002 eV, deep in the classical regime; while a neutron confined to a nucleus-sized box of 10 femtometres is flung back up to MeV energies by the tiny L. Between electrons in quantum dots, π-electrons in dye molecules, neutrons in nuclei and electrons in metals, this one skeleton formula organises an astonishing census of real systems. The examples below walk that census; the calculator puts the numbers in your hands.

n=3: 9E₁ n=2: 4E₁ n=1: E₁ box width L walls: V = ∞

Formula

En = n²h² / (8mL²), n = 1, 2, 3, … • ground state E₁ = h² / (8mL²) • transition energy ΔE = (n₂² − n₁²) × E₁ • fitted wavelength λn = 2L / n

The derivation is three steps and worth owning. The standing wave that fits must vanish at both walls, so L holds a whole number of half-wavelengths: L = nλ/2, giving λn = 2L/n. De Broglie turns wavelength into momentum, p = h/λ = nh/(2L). Kinetic energy is p²/2m — and substituting gives En = n²h²/(8mL²), with no potential energy inside the box at all. The rearrangements are the working tools: the box size implied by a measured level is L = nh/√(8mE); a transition's photon has λphoton = hc/ΔE. Unit discipline is the one real hazard — the formula is SI to its bones, so L must be converted from nanometres to metres (× 10−9) before squaring, a step this calculator performs for you: you enter L in nm and a mass in kg (or pick a preset particle), and receive E₁ and En in joules and electronvolts.

SymbolMeaningUnits
nquantum number — counts half-wavelengths in the standing wave1, 2, 3, …
Lbox width (entered in nm, converted to m internally)nm → m
mparticle masskg
E₁ground-state (zero-point) energy, h²/(8mL²)J or eV
λnde Broglie wavelength of the fitted standing wave, 2L/nm

Standing waves, nodes and where the particle actually is

The wavefunction of level n is a sine arch — or several — stretched between the walls, and its square gives the probability of finding the particle at each position. Two consequences regularly ambush intuition. First, the ground state's probability peaks at the box's centre: the particle is most likely mid-box, least likely near the walls it cannot touch. Second, excited states have nodes — interior points where the wavefunction crosses zero and the particle is never found. The n = 2 state, two arches with a node at the centre, is exactly as likely to be in the left half as the right, yet has zero probability at the midpoint between them; it cannot be "passing through" in any classical sense, because it is not a trajectory at all but a standing pattern. As n grows the pattern's ripples multiply and their average flattens towards the classical expectation — a fast particle spends roughly equal time everywhere — which is the correspondence principle arriving on schedule: quantised at small n, classical in the average at large n.

The node structure is not a curiosity; it is engineering material. In quantum wells and dots, which states couple to light, which transitions are allowed, and how electrons leak between neighbouring wells are all questions about how these sine patterns overlap. The infinite walls of the textbook box are the idealisation: real confinements — a semiconductor heterojunction, a dye molecule's π system, a nucleus's potential — have finite depth, so the wavefunction leaks a short distance into the walls, the effective box is slightly wider than the physical one, and every level sits slightly lower than this calculator's value. The infinite-box answer is the benchmark from which those refinements are measured, and for deep, tight confinements it is accurate to a few percent.

|ψ|² for n=1: most likely mid-box n=2: a node at the centre — never found there

How to use

  1. Pick a particle — electron, proton or neutron — or choose "Custom mass" and type a mass in kg (like 9.11e-31).
  2. Enter the box width L in nanometres and the quantum number n.
  3. Click "Calculate Energy Level" to see E₁ and En in joules and electronvolts.
  4. For a transition (the photon absorbed or emitted between levels), run the calculator for both levels and subtract — or use ΔE = (n₂² − n₁²)E₁. Remember the scaling checks: doubling L quarters every energy; doubling n quadruples En. If your result violates either, a unit has slipped.

Worked examples

Example 1 — an electron in a 1 nm box. An electron in a box of width L = 1 nm:
E₁ = h² / (8mL²) = (6.626 × 10−34)² / (8 × 9.11 × 10−31 × (1 × 10−9)²)
= 6.024 × 10−20 J = 0.376 eV
For n = 2: E₂ = 4 × E₁ = 1.504 eV
These are the energy scales of real quantum dots — nanometre-sized boxes that trap electrons in modern electronics. The 1 → 2 transition energy, 3 × 0.376 = 1.128 eV, corresponds to a photon of about 1,100 nm in the near infrared.

Example 2 — the same electron in a 0.5 nm box. Halving the box quadruples every level (1/L²):
E₁ = 0.376 × 4 = 1.504 eV; E₂ = 6.017 eV; E₃ = 9 × 1.504 = 13.54 eV.
Half-nanometre confinement is atomic scale — and sure enough, the energies have become atomic: hydrogen's entire ground-state binding is 13.6 eV. Confinement at the size of an atom costs atomic energies; the formula and the atom agree on what "small" means.

Example 3 — an electron in a 10 nm quantum well. Ten times wider, a hundred times softer:
E₁ = 0.376 ÷ 100 = 0.00376 eV (3.76 meV, = 6.024 × 10−22 J)
ΔE₁₂ = 3 × E₁ = 0.01128 eV → photon wavelength hc/ΔE ≈ 110 µm, far infrared.
This is the working regime of quantum-well infrared photodetectors (QWIPs), which image heat by promoting electrons between exactly such levels — the calculator's arithmetic is their design equation.

Example 4 — a proton in the 1 nm box. Same box, 1,836 times the mass:
E₁ = 6.024 × 10−20 × (9.11 × 10−31 / 1.673 × 10−27) = 3.280 × 10−23 J = 0.000205 eV.
Two ten-thousandths of an electronvolt — far below room-temperature kT (0.0259 eV), so a nanometre-confined proton is thermally classical, its levels a continuum for any practical purpose. Mass is destiny in this formula.

Example 5 — why dyes are coloured: an electron in a 0.8 nm molecular box. The π electrons of a dye molecule roam a box roughly the molecule's length. For L = 0.8 nm:
E₁ = 0.376 ÷ 0.64 = 0.588 eV
ΔE₁₂ = 3 × 0.588 = 1.763 eV → λ = hc/ΔE = 704 nm — deep red absorbed, so the dye shows the complementary colour.
Lengthen the conjugated chain (bigger L) and the absorption reddens further — the classic Kuhn model of cyanine dyes, and the reason a homologous series of dyes marches through the spectrum in step with molecular length.

Example 6 — a neutron in a nucleus-sized box, L = 10 fm. Now shrink L to 10−5 nm and use the neutron's mass:
E₁ = h² / (8 × 1.675 × 10−27 × (10−14)²) = 3.276 × 10−13 J = 2.045 MeV.
MeV — the energy scale of nuclear physics — falls out of a box the size of a nucleus with no nuclear physics inserted. This is the standard back-of-envelope proof that nuclear energies are MeV because nuclei are femtometres across: confinement energy is set by size alone.

The particle in a box in real life

Quantum dots and QLED displays. A semiconductor nanocrystal is a 3D box for its electrons; its emission colour shifts with diameter because confinement energies scale as 1/L² — smaller dots, bluer light. Display manufacturers tune reds and greens by growing dots to nanometre tolerances, applying this formula at production scale.

Dye and pigment colour. The π-electron box model (Example 5) explains the colour progression of cyanine dyes and gives a first estimate for conjugated molecules generally — polyenes, carotenoids (β-carotene's orange is a long box at work), and the chromophores of vision.

Quantum wells in lasers and detectors. Semiconductor lasers confine electrons in layers a few nanometres thick; the box levels set the emission wavelength, engineered layer by layer. QWIP detectors (Example 3) run the same physics in reverse, absorbing far-infrared photons across box-level gaps.

Electrons in metals. A metal's conduction electrons fill a 3D box — the crystal itself — up to the Fermi energy, level by level, two per state. The box model grows up into the free-electron theory of metals, explaining their heat capacities, conductivities and work functions.

Nuclear energy scales. Example 6's trick is used constantly: confinement in femtometre boxes sets MeV scales, so nucleon level spacings, and the kinetic energies nucleons must have inside nuclei, are estimated from h²/(8mL²) before any detailed nuclear model is consulted.

Nanowires and 2D materials. Confine in two directions and you have a quantum wire; in one, a well; in all three, a dot. The taxonomy of nanostructures is this formula applied dimension by dimension, and the density of states of each follows from counting its box levels.

E₁ 4E₁ 9E₁ 16E₁ gaps grow: 3E₁, 5E₁, 7E₁… levels spread as n² — contrast the atom's crowding ladder and the oscillator's even rungs

Boxes in two and three dimensions: degeneracy appears

Real confinements are rarely one-dimensional, and the extension is graceful: in a rectangular box, each direction contributes its own term, E = (h²/8m)(nx²/Lx² + ny²/Ly² + nz²/Lz²). For a cubic box of side L this is E = E₁(nx² + ny² + nz²) with E₁ the 1D ground value — and something new happens: different quantum-number triples can give the same energy. The state (2,1,1), (1,2,1) and (1,1,2) all total 6E₁: a threefold degeneracy, forced by the cube's symmetry. Fill a 3D box with many electrons, two per state, and you have the free-electron model of a metal, whose topmost filled level — the Fermi energy — is a few eV for typical electron densities, computed by counting box states exactly this way. Stretch the cube into a well, wire or dot and the degeneracy splits in ways device physicists exploit daily. The 1D formula on this page is the seed of all of it.

Quick reference: electron ground-state energy by box width

Box width LE₁ (eV)ΔE₁₂ (eV)Where it occurs
0.1 nm37.60112.8sub-atomic confinement
0.2 nm9.40128.20small molecules
0.5 nm1.5044.513molecular boxes, dyes
1 nm0.3761.128small quantum dots
2 nm0.09400.282quantum dots
5 nm0.015040.0451quantum wells
10 nm0.003760.01128wide wells, QWIPs

Two decades of box width — 0.1 to 10 nm — sweep four decades of energy, from tens of electronvolts down to milli-electronvolts, ultraviolet to far-infrared. That enormous, predictable leverage is the 1/L² law, and it is the entire design principle of nanostructured electronics in one table.

Common mistakes

  • Squaring L in nanometres. The formula wants metres: L = 1 nm is 10−9 m, and its square is 10−18, not 1. Entering "1" into a raw SI calculation understates E₁ by eighteen orders of magnitude. This calculator converts for you — hand calculations must do it themselves.
  • Expecting levels proportional to n. They go as n²: E₃ is nine times E₁, not three times. Assuming even spacing imports the harmonic oscillator's ladder into the wrong system and wrecks every transition energy.
  • Expecting a zero-energy ground state. E₁ = h²/(8mL²) is the box's zero-point energy — the particle cannot sit still because a motionless state has no definite wavelength and cannot fit the box. Confined means restless, here exactly as for the oscillator.
  • Using the electron's mass for every particle. The 0.376 eV figure at 1 nm belongs to the electron alone. A proton in the same box sits at 0.000205 eV (Example 4). Check which mass your problem actually confines.
  • Treating the infinite-wall answer as exact for real systems. Finite wells leak: wavefunctions penetrate the walls, levels drop below the infinite-box values, and a finite number of bound states exists. Use this page's numbers as the benchmark and expect real devices to sit a few to tens of percent lower.

FAQ

Why can't the particle have zero energy?
A standing wave must fit in the box, so the shortest possible wavelength is 2L. That gives the particle a minimum momentum and hence a minimum (zero-point) energy — it can never sit perfectly still.

Why do the levels spread out as n grows?
Because En grows with n², the gaps widen: E₂ − E₁ = 3E₁, E₃ − E₂ = 5E₁, and so on. This is different from the harmonic oscillator, whose levels are evenly spaced.

Where is the particle-in-a-box model used?
It explains the colour of dye molecules (electrons in a molecular "box"), the behaviour of quantum dots and nanowires, and gives a first estimate of energy levels in any tightly confined quantum system.

Why is the ground-state wavelength 2L?
The standing wave must vanish at both walls, and the simplest pattern that does so is a single half-wavelength arch: L = λ/2, so λ = 2L. That longest possible wavelength means the smallest possible momentum, h/2L, and hence the ground energy — the box quantises by fitting, and 2L is the largest thing that fits.

What is a node, physically?
A point where the wavefunction is permanently zero, so the particle is never detected there. Level n has n − 1 interior nodes. Nodes are not barriers the particle crosses; the state is a standing pattern, not a journey, and its probability distribution simply has holes at the nodes.

Does the model work in three dimensions?
Yes — each direction contributes n²/L² for its own quantum number, and cubic boxes show degeneracy: distinct states sharing one energy. The 3D version, filled with electrons, becomes the free-electron theory of metals, one of the most successful simple models in solid-state physics.

What changes if the walls are finite?
The wavefunction leaks exponentially into the walls instead of stopping dead, the effective box widens, levels drop, and only finitely many bound states survive — shallow boxes may hold just one. Tunnelling through finite walls is also what makes the scanning tunnelling microscope possible.

Why don't we see these effects for everyday objects?
Scale. A dust grain of mass 10−15 kg in a 1 µm "box" has E₁ ≈ 5 × 10−41 J, against thermal energies around 10−21 J — the levels are twenty orders of magnitude too fine to notice. Quantisation by confinement is a small-mass, small-box phenomenon, which is why it rules nanometres and never furniture.

How is this different from the harmonic oscillator?
The well's shape decides the ladder: a parabola gives even rungs starting at ½hf; a square box gives rungs spreading as n² starting at h²/(8mL²). Both share the deep features — discreteness from confinement, an unremovable zero-point energy — which is why the two models are taught as a pair.

Can the box model predict a real spectrum?
To surprising accuracy, in the right systems: cyanine dye absorption wavelengths follow the free-electron box model within a few percent once the box length is taken as the conjugated chain plus one bond at each end. For quantum dots and wells it gives the correct scaling and good estimates; precision device work then refines it with finite walls and effective masses.

Yuki Tanaka

Yuki Tanaka

Physics Editor · Modern Physics

Yuki Tanaka creates and reviews our modern physics, relativity and cosmology calculators at CalcVIP. Every calculator is checked against hand-worked examples before it is published, so the formula, the diagram and the answer all agree.

View full profile & all calculators by Tanaka →