Particle-in-a-Box Energy Calculator

What this calculator models

The particle-in-a-box model is one of the first places where quantum mechanics stops feeling like a purely symbolic subject and becomes something you can calculate and visualize. Imagine a single particle trapped inside a one-dimensional region of length L with walls so high that the wavefunction must be exactly zero at both ends. In a classical picture, the particle could carry almost any kinetic energy while bouncing between the walls. In the quantum version, that freedom disappears. Only standing waves that fit neatly inside the box are allowed, and each allowed wave corresponds to a specific energy level. This calculator turns that rule into a quick numerical tool: you enter the box length, the particle mass, and the quantum number, and the page returns the allowed energy of that state.

This simple model matters because confinement changes behavior dramatically at very small scales. The same idea helps students understand why nanoscale systems have discrete energy levels, why shrinking a structure can spread those levels apart, and why certain optical or electronic properties shift when a device becomes tiny. Real quantum dots, semiconductor wells, and molecular systems are more complicated than an infinite one-dimensional box, but the ideal model is still valuable because it isolates the central idea cleanly. If you want to check homework, build intuition for quantum confinement, or compare how energy responds to changing size or mode number, this page gives you a direct answer without burying the physics under too much setup.

Understanding the inputs

Box Length L (nm) is the width of the one-dimensional well. The form uses nanometers because many confinement problems are naturally discussed at atomic and nanoscale dimensions. Internally, the calculator converts your value to meters before applying the formula, so you should type the physical length in nanometers exactly as labeled. This input is especially important because the energy varies as 1/L2. That means shrinking the box just a little can raise the result a lot. Physically, the wave has less room to fit between the walls, so it must curve more sharply, and that sharper curvature corresponds to higher kinetic energy in the quantum solution.

Particle Mass m (kg) is the mass of the trapped particle in kilograms. The default value, 9.109 Ɨ 10⁻³¹ kg, is the electron mass, which is the most common classroom example and a sensible starting point for exploring the model. If you change the mass to a heavier particle, the allowed levels move closer together because the same wavelength implies less kinetic energy for a larger mass. This is also where many practical mistakes happen. In some solid-state problems you may need an effective mass inside a material rather than the free-electron mass in vacuum. The formula is the same, but the choice of m changes the scale of the answer, sometimes by a large factor.

Quantum Number n selects the allowed standing-wave mode. It must be a positive integer: 1, 2, 3, and so on. The ground state is n = 1, not zero. That detail is not a convention or a software restriction; it comes from the boundary conditions. A state with zero wave inside the box would not represent a physical particle, so the first nontrivial standing wave is the half-wave pattern associated with n = 1. As n increases, more half-wavelengths fit inside the same box, the wave gains more nodes, and the energy rises as n2. Because of that square-law dependence, the higher levels spread out faster than many new learners first expect.

The formula behind the result

For a one-dimensional infinite potential well, the allowed energy of the nth state is

En = n2 h2 8 m L2

Here h is Planck's constant, m is the particle mass, and L is the box length in meters. The calculator reports the answer in both joules and electron-volts. Joules are the direct SI output of the formula, while electron-volts are often easier to interpret in atomic, molecular, and nanoscale contexts. Three scaling rules are worth remembering because they explain almost every trend you will see on this page: energy grows with n2, energy falls with mass, and energy falls with L2. If you double n, the energy becomes four times larger. If you double L, the energy becomes one quarter as large. If you keep the same geometry but use a heavier particle, the level spacing shrinks.

One especially important consequence is that the lowest allowed energy is not zero. Even the ground state carries a nonzero zero-point energy because a standing wave with one half-wavelength still has to fit inside the box. The particle cannot simply sit motionless in the middle with both its position and momentum perfectly specified. That nonzero ground-state value is one of the clearest ways quantum confinement differs from classical motion. When the box becomes very small, the zero-point energy itself can become large enough to dominate the physical picture.

There is also a helpful qualitative way to read the formula. The quantum number behaves like a staircase control: moving from n = 1 to 2 or from 2 to 3 is a jump between distinct modes. The box length behaves like a smooth tuning knob: sliding L up or down continuously shifts every allowed level. When you test scenarios with the form, change only one input at a time at first. That makes the two main patterns of the model easy to see. Higher modes are much more energetic, and tighter confinement raises every level quickly.

At the software level, this page still behaves like any other calculator: it accepts several inputs, applies a function, and returns a result. The two general MathML blocks below are kept to show that broader computational structure, but the specific physics on this page is the particle-in-a-box formula above.

R = f ( x1 , x2 , … , xn ) T = āˆ‘ i=1 n wi Ā· xi

Worked example

Suppose the particle is an electron, the box length is 1 nm, and you want the ground state. Enter L = 1, m = 9.109 Ɨ 10⁻³¹ kg, and n = 1. The calculator returns an energy of about 6.02 Ɨ 10⁻²⁰ J, which is about 0.376 eV. Now change only the quantum number to n = 2. The new value is about 1.504 eV, which is exactly four times larger because the formula depends on n2. If instead you return to n = 1 and cut the box length to 0.5 nm, the result also becomes four times larger because halving L multiplies the energy by 1/(0.5)2 = 4.

This is why the model is so useful for intuition. You do not need a long catalog of separate rules. Most quick estimates come from reading the proportionality correctly: E grows with n2, shrinks with m, and shrinks with L2. Once that pattern is clear, the numeric calculation mostly tells you the scale of the effect. It answers questions such as whether the level is in a fraction of an electron-volt range, whether the spacing is large enough to matter at room temperature, or whether a modest geometric change would strongly alter the allowed states.

The table below keeps the mass and box length fixed at the default electron and 1 nm so you can see how the allowed levels fan out as n increases.

State Energy (eV) Interpretation
n = 1 0.376 Ground state; the lowest nonzero standing-wave pattern that fits in the box.
n = 2 1.504 First excited state; four times the ground-state energy.
n = 3 3.384 Nine times the ground-state energy; the wavefunction has two interior nodes.
n = 4 6.016 Sixteen times the ground-state energy; the level spacing continues to widen.

Those numbers also show that the gaps themselves are not constant. The jump from n = 1 to 2 is about 1.128 eV, but the jump from 2 to 3 is larger, and the jump from 3 to 4 is larger again. That widening separation is another direct consequence of the square dependence on n.

How to read the answer

The result area shows one allowed energy level, not the energy difference between two levels. If you want the energy required to excite the particle from one state to another, calculate both levels and subtract. In the 1 nm electron example, the transition from n = 1 to n = 2 is about 1.504 āˆ’ 0.376 = 1.128 eV. That difference, rather than the absolute energy of one state alone, is often the quantity used in spectroscopy or absorption discussions. The calculator gives both joules and electron-volts so you can work in whichever unit fits your context.

Sanity checks are straightforward in this model. If you increase n, the energy should never decrease. If you make the box wider, the energy should never increase. If you switch from an electron to a much heavier particle while keeping the same L and n, the energy should drop. When one of those expectations fails, the cause is usually a unit mistake, a typo in scientific notation, or an accidental non-integer value of n. The form validates the main rules, but a quick physical reasonableness check is still worth doing.

  • Watch the units: the length field is in nanometers, not meters. Enter 1 for a 1 nm box, not 1 Ɨ 10⁻⁹.
  • Use a positive integer for n: fractional quantum numbers do not belong in this idealized model.
  • Be explicit about the mass: free-particle mass and effective mass can differ substantially.
  • Expect scientific notation: very wide boxes or heavy particles can produce tiny energies, and that is physically reasonable.

Assumptions and limitations

The model on this page is intentionally idealized. It assumes a single particle moving in one dimension inside an infinite well, meaning the walls are perfectly rigid and the potential outside the box is impenetrably large. Real systems may have finite barriers, three-dimensional geometry, interactions with other particles, spin effects, or material-dependent band structure. Those details can shift the allowed energies, change transition rules, or introduce features that are not represented by this simple expression.

That does not make the calculator less useful; it just defines the situations where it is strongest. This page is excellent for building intuition, checking algebra, and estimating the order of magnitude of energy spacing under quantum confinement. It is not a replacement for a finite-well calculation with boundary matching, a full semiconductor effective-mass model, or an ab initio simulation. If your problem statement explicitly mentions finite barriers, degeneracy, many-body interactions, or multidimensional confinement, treat the result here as a first pass rather than the final word.

Another quiet assumption is that the motion is nonrelativistic. For the box sizes and particle masses found in most textbook problems, that is perfectly appropriate. If you push the parameters to extremes, you should remember that the simple kinetic-energy operator used in the standard derivation may no longer be the right physical description. In everyday educational use, though, the biggest practical source of error is not exotic physics. It is usually a mixed-up unit conversion, an inconsistent choice of mass, or forgetting that only whole-number modes are allowed.

Using the calculator well

A good habit is to evaluate a small family of cases rather than only one isolated input set. Start with the baseline values you care about, then try one smaller box and one larger box, or one lower mode and one higher mode. That quick sweep shows whether your conclusion is robust or whether it depends on a narrow parameter choice. Because the particle-in-a-box formula is so sensitive to length, even a modest comparison often teaches more than a single carefully typed number.

If you are learning or teaching the topic, pair the numbers with a sketch of the standing wave. Draw the walls, count the half-wavelengths that fit inside, and then compare that picture to the numerical result. The optional mini-game below is built around that exact idea. It lets you tune the well width and mode number under time pressure so the relationship between confinement and energy becomes something you can feel, not just read. The game does not alter the calculator's math or result panel. It simply turns the same rule into a fast hands-on exercise.

Enter the well dimensions and quantum state

Use L in nanometers, m in kilograms, and n as a positive whole number. The default mass is the electron mass, and the default example length is 1 nm.

Smaller boxes force shorter wavelengths and therefore higher energies. For an electron, use about 9.109 Ɨ 10⁻³¹ kg. Heavier particles have lower energy spacing in the same box. n = 1 is the ground state. Only positive integers are allowed in this model.
The example values describe an electron in a 1 nm box at n = 1. Press Compute Energy to see the corresponding energy in joules and electron-volts.

Status messages will be announced here.

Optional mini-game: Quantum Well Tuner

This optional canvas mini-game uses the same idea as the calculator. When you press start, it reads the current mass field from the form, then asks you to match target quantum modes by changing the box width and mode number. Drag the wall to adjust L, tap the minus or plus pads to change n, and hold your energy line inside the glowing target band to lock in a level. It is separate from the calculator result, but it reinforces the same relationship: energy rises with n2 and falls with L2.

Score: 0 Streak: 0 Time: 75 Locks: 0 Best: 0

Click to play: Quantum Well Tuner

Drag the glowing right wall to change the box length L. Tap the minus and plus pads, or use the arrow keys, to change the quantum number n.

Match the target mode and hold your energy line inside the luminous target band to lock in a level. The challenge escalates with drifting targets and tighter tolerances, so quick retuning matters.

Embed this calculator

Copy and paste the HTML below to add the Particle-in-a-Box Energy Calculator | Infinite Well Energy Levels to your website.