The wave-particle duality simulator is a free interactive lab built around one relation, lambda = h / p, and around one apparatus that makes both faces of it visible at once. Electrons leave a gun, cross a barrier with two slits and are recorded on a screen drawn as a vertical strip — one small mark per electron, at the position where that electron landed. The thin line beside the strip is the intensity the model predicts, so the marks can be watched filling it in. Four sliders set the voltage and the three lengths; one button asks which slit was used, and the Fringe visibility card falls from 1.00 to 0.00 when you press it.
Single electrons through a double slit. Fire them one at a time with Fire 1 electron: each arrives as one localised dot. Let the stream run and the dots pile into interference fringes. Switch the which-way detector on and the fringes go, leaving the single-slit envelope. lambda = h / p with p = sqrt(2 m_e e V); the apparatus at the left is schematic, not to scale.
Each button writes the four sliders and sets the which-way detector, which together are the whole state, so a load never inherits anything from the last one. It does not clear the screen: the lab keeps the electrons already detected and re-draws them from the new curve, so what you see is the pattern the new setting predicts. Work down the list in order — the first three change one thing at a time, and the fourth changes the question rather than the apparatus.
Pick a case above, or move the four sliders and press the detector yourself.

The wave-particle duality simulator is a free interactive physics lab that runs in your browser, with nothing to install and no sign-up. It fires electrons at a barrier with two slits and draws the detection screen one dot at a time, so the two faces of a quantum object arrive separately: each electron is recorded as a single localised hit, and only the pile of hits shows the interference pattern that needed both slits to be open.
Four sliders set the apparatus and one button changes the question being asked. The accelerating voltage runs 20 to 600 V in steps of 20, the slit separation 300 to 1000 nm in steps of 50, the slit-to-screen distance 0.10 to 1.00 m in steps of 0.05, and the slit width 20 to 200 nm in steps of 10. Which-way detector: OFF becomes Which-way detector: ON on one press, and that press is the whole experiment: the fringes vanish and the broad single-slit envelope is all that is left.
Ten readouts answer. Four cards give the de Broglie wavelength, the fringe spacing, the number of electrons detected and the fringe visibility; six compact cells add the momentum, the speed as a fraction of the speed of light, the angle to the first maximum, the envelope’s first zero, how many maxima fit inside that envelope on one side, and the slit gap divided by the slit width. At the setting the lab boots in they read 122.6 pm, 122.65 um, 1.00, 5.403e-24 kg m/s, 0.020 c, 0.245 mrad, 613.2 um, 4 and 5.0.
The stream starts itself when the page loads and stops itself at 20,000 detections, so the pattern is already building when you arrive. Fire 1 electron pauses the stream and sends exactly one more, which is the state worth looking at: one dot, nowhere near the middle, telling you nothing on its own. Reset clears the dots and the count and leaves the stream paused, so that state is always one click away.
Three things this lab is honest about. The visibility figures 1.00 and 0.00 are the ideal limits of the intensity equation, computed from the model rather than estimated from the dots, and a real which-way measurement decoheres only partly and leaves a visibility between the two. The dot positions come from a seeded pseudo-random generator, which models quantum randomness and is not a quantum random source. The apparatus drawn at the left is schematic: the gap and the openings grow with the slit separation and the slit width, but they are not to scale.
| Control | What it sets | Step or default |
|---|---|---|
| Accelerating voltage | 20 to 600 V | steps of 20 V, boots at 100 V |
| Slit separation d | 300 to 1000 nm | steps of 50 nm, boots at 500 nm |
| Slit width a | 20 to 200 nm | steps of 10 nm, boots at 100 nm |
| Slit-to-screen distance L | 0.10 to 1.00 m | steps of 0.05 m, boots at 0.50 m |
| Which-way detector | OFF or ON | one button, boots OFF |
| Buttons | Play, Fire 1, Reset | the stream boots running |
position on screen (um) — window +/- 981.2 um and window is +/- 981.2 um = 8 fringe spacings, the smaller of the two rules. The drawing never rescales silently: it states its window in micrometres and names which of its two candidate windows won.h = 6.62607015e-34 J s · m_e = 9.109e-31 kg · the stream stops at 20,000 detections. That is the whole of what the panel assumes, in one line, and it is worth copying alongside any figure you take from here.The step worth repeating is the sixth one. Load Default double slit, let the fringes build, then press the detector without touching a slider. The stripes fill in and the broad hump of a single slit is left behind, while the wavelength, the momentum, the speed, the angle, the envelope and the fringe spacing all hold their values. What changed was the question the apparatus asks, not the apparatus.
For what duality is — the evidence on both sides, where lambda = h / p comes from, why everyday objects never show fringes, and seven worked problems — read the full guide to wave-particle duality. This page is about the panel and the drawing: what each readout proves, and where the picture gives up before the numbers do.
Every row below is one setting of the four sliders and the detector, and every cell is a string the running lab printed there. These five settings are the ones this page publishes as presets, so they are also the ones the lab’s own tests pin. Where a cell and the lab ever part company, believe the lab.
| Setting | Wavelength | Fringe spacing | Visibility | Momentum | Envelope first zero | Maxima in envelope |
|---|---|---|---|---|---|---|
| Default double slit | 122.6 pm | 122.65 um | 1.00 | 5.403e-24 kg m/s | 613.2 um | 4 |
| Wider slit gap | 122.6 pm | 61.32 um | 1.00 | 5.403e-24 kg m/s | 613.2 um | 9 |
| Faster electrons | 61.3 pm | 61.32 um | 1.00 | 1.081e-23 kg m/s | 306.6 um | 4 |
| Which-way detector on | 122.6 pm | 122.65 um | 0.00 | 5.403e-24 kg m/s | 613.2 um | 4 |
| Narrow slits, broad envelope | 122.6 pm | 245.29 um | 1.00 | 5.403e-24 kg m/s | 6132.4 um | 24 |
Rows 1 and 2 separate the electron from the apparatus. Doubling the slit separation leaves the wavelength and the momentum untouched — 122.6 pm and 5.403e-24 kg m/s in both — and halves the fringe spacing, 122.65 to 61.32 um. The envelope cell does not move either, because it depends on the slit width and not on the gap. So nine fringes now fit inside the same 613.2 um where four fitted before.
Rows 1 and 3 are the opposite experiment. Four times the voltage halves the wavelength to 61.3 pm, and this time everything about the pattern shrinks with it: the fringe spacing halves to 61.32 um and the envelope halves to 306.6 um, so Maxima in envelope is unchanged at 4. Rows 2 and 3 therefore print the same 61.32 um fringe spacing from two quite different electrons, which is the trap the table is set to catch.
Rows 1 and 4 are the same apparatus asked a different question. Five of the six readings are identical; only Visibility differs, 1.00 against 0.00. Both of those are the ideal limits of the intensity equation and not readings from a detector — the breakdown list below says what a real measurement would leave instead.
Hold the voltage, the separation and the screen distance at their boot values and walk the Slit width a slider across its whole range. Two columns refuse to move and three change together, and the last of them is the one that decides which order goes missing.
| Setting | Wavelength | Fringe spacing | Envelope first zero | Maxima in envelope | Slit gap over slit width |
|---|---|---|---|---|---|
| Slit width 20 nm | 122.6 pm | 122.65 um | 3066.2 um | 24 | 25.0 |
| Slit width 40 nm | 122.6 pm | 122.65 um | 1533.1 um | 12 | 12.5 |
| Slit width 60 nm | 122.6 pm | 122.65 um | 1022.0 um | 8 | 8.3 |
| Slit width 100 nm | 122.6 pm | 122.65 um | 613.2 um | 4 | 5.0 |
| Slit width 140 nm | 122.6 pm | 122.65 um | 438.0 um | 3 | 3.6 |
| Slit width 200 nm | 122.6 pm | 122.65 um | 306.6 um | 2 | 2.5 |
Read the last two columns against each other. Where the ratio lands on a whole number — 25.0, 12.5 is not one, 5.0 — the count is one less than it, because the order with that number arrives exactly where the envelope has already fallen to zero and is wiped out. Where the ratio is not a whole number, 8.3 or 3.6, nothing is lost and the count is simply the number of whole orders that fit. The spreading of one slit on its own is ordinary diffraction, which the guide to diffraction handles properly.
The 200 nm row is also where the drawing changes its mind about the window. At every other setting in this table the caption reads 8 fringe spacings; at 200 nm it reads window is +/- 919.8 um = 3 envelope first zeros, the smaller of the two rules, because three envelope zeros is now the narrower of the two candidates. The axis label changes with it and the figure is restated in micrometres either way.
This is the pair worth dwelling on, and it is a warning rather than a curiosity. Keep the slits 500 nm apart and 100 nm wide, then reach 61.32 um fringes two ways: raise the voltage to 400 V, or leave it at 100 V and bring the screen in to 0.25 m.
| Setting | Wavelength | Momentum | Speed | Angle to first maximum | Fringe spacing | Envelope first zero |
|---|---|---|---|---|---|---|
| 100 V, screen at 0.25 m | 122.6 pm | 5.403e-24 kg m/s | 0.020 c | 0.245 mrad | 61.32 um | 306.6 um |
| 400 V, screen at 0.50 m | 61.3 pm | 1.081e-23 kg m/s | 0.040 c | 0.123 mrad | 61.32 um | 306.6 um |
Both rows draw the same picture. The fringe spacing agrees to the last digit the card prints, the envelope agrees, the maxima count agrees at 4 and the plotted window agrees — yet one electron has twice the wavelength of the other and half its momentum. The cells that separate them are the ones the screen cannot show you on its own: Angle to 1st maximum, 0.245 mrad against 0.123 mrad, and the wavelength, the momentum and the speed behind it.
So a pattern measured in micrometres does not by itself tell you the wavelength. You need the screen distance as well, and that is exactly why a real measurement of a matter wavelength is a measurement of a geometry. The guide to the de Broglie wavelength works the relation through from the other end, and the de Broglie wavelength lab plots it across masses no electron gun could ever reach.
The table below was compiled from the settings harvested for this page rather than asserted from the formulae: a readout is listed as moving only if it was observed to move across that control’s own range, with the other three held at their boot values. It is the fastest way to find out whether a reading you care about is a property of the electron or of the apparatus.
| Control | What moves | What cannot move |
|---|---|---|
| Accelerating voltage | De Broglie wavelength, Fringe spacing, Momentum, Speed, Angle to 1st maximum, Envelope first zero | Fringe visibility, Maxima in envelope, Slit gap over slit width |
| Slit separation d | Fringe spacing, Angle to 1st maximum, Maxima in envelope, Slit gap over slit width | De Broglie wavelength, Fringe visibility, Momentum, Speed, Envelope first zero |
| Slit-to-screen distance L | Fringe spacing, Envelope first zero | De Broglie wavelength, Fringe visibility, Momentum, Speed, Angle to 1st maximum, Maxima in envelope, Slit gap over slit width |
| Slit width a | Envelope first zero, Maxima in envelope, Slit gap over slit width | De Broglie wavelength, Fringe spacing, Fringe visibility, Momentum, Speed, Angle to 1st maximum |
| Which-way detector | Fringe visibility, the drawn curve, the first caption line | all nine other readouts |
Three patterns fall out of it. Only the voltage touches the electron itself, so only the voltage can move the wavelength, the momentum and the speed. The screen distance is pure magnification: it moves the two lengths measured on the screen and nothing else, not even the angle. And the detector button moves exactly one number, which is what makes it an argument rather than a knob.
The panel prints its two relations on itself, inside the labels of the cards they feed. lambda = h / p sits above the De Broglie wavelength card and w = lambda L / d above the Fringe spacing card, so neither answer arrives without the rule that produced it. Neither is derived here.
Behind the first of them is a third relation, printed in the lab’s opening band but on none of the cards: the momentum an electron picks up falling through a potential difference, p = sqrt(2 m_e e V), which is where the voltage slider gets in. Where that relation comes from, and the arithmetic of turning a mass and a speed into a wavelength, belongs to the de Broglie wavelength guide rather than to this panel.
| Symbol | Meaning | SI unit | In this lab |
|---|---|---|---|
| V | Potential difference the electron is accelerated through from rest. It is the only control that changes what the electron is rather than where the apparatus sits | volt | 20 to 600 in steps of 20, printed beside the slider: “20 V”, “100 V” (the boot value), “600 V”. |
| d | Separation of the two slits, centre to centre. It sets how finely the two paths interfere, and with the slit width it fixes which order goes missing | metre (the slider is in nanometres) | 300 to 1000 in steps of 50: “300 nm”, “500 nm” (the boot value), “1000 nm”. |
| L | Distance from the barrier to the detection screen. It magnifies the pattern without touching the physics upstream of it | metre | 0.10 to 1.00 in steps of 0.05: “0.10 m”, “0.50 m” (the boot value), “1.00 m”. |
| a | Width of each slit. It sets the single-slit envelope the fringes have to live inside, and nothing else | metre (the slider is in nanometres) | 20 to 200 in steps of 10: “20 nm”, “100 nm” (the boot value), “200 nm”. Always smaller than d, by construction of the two ranges. |
| p | Momentum the electron leaves the gun with, in the Momentum p cell. The card above it prints the relation that produced it | kilogram metre per second | a three-decimal mantissa: “2.416e-24 kg m/s” at 20 V, “5.403e-24 kg m/s” at the boot setting, “1.323e-23 kg m/s” at 600 V. |
| lambda | De Broglie wavelength of that electron, on the headline card. Its own label prints lambda = h / p, so the answer never arrives without the rule |
metre (the card is in picometres) | one decimal of a picometre: “274.2 pm” at 20 V down to “50.1 pm” at 600 V, with “122.6 pm” at the boot setting. |
| w | Spacing between neighbouring bright fringes on the screen, on the second card, whose label prints w = lambda L / d |
metre (the card is in micrometres) | two decimals of a micrometre: “24.53 um” at the near screen stop, “122.65 um” at the boot setting, “274.24 um” at 20 V. |
| theta | Angle from the axis to the first bright fringe, in the Angle to 1st maximum cell. It is what the fringe spacing looks like before the screen distance magnifies it | radian (the cell is in milliradians) | three decimals of a milliradian, and small everywhere: “0.050 mrad” at the shortest wavelength and widest gap, “0.245 mrad” at the boot setting, “0.914 mrad” at the longest wavelength and narrowest gap, which is 20 V with d at 300 nm. Only V and d move this cell at all. |
| envelope first zero | Where one slit on its own sends nothing, from a sin(theta) = lambda. In the Envelope first zero cell, measured on the screen like the fringe spacing |
metre (the cell is in micrometres) | one decimal of a micrometre: “306.6 um” at the widest slits, “613.2 um” at the boot setting, “3066.2 um” at the narrowest. |
| visibility | Contrast of the fringes, on the fourth card. It is computed from the intensity equation’s limits, not estimated from the dots on the screen | none (a ratio) | two decimals, and only ever two values: 1.00 with both paths open and 0.00 once the detector is on. |
| h | The Planck constant, in the fixed line under the readouts. Exact by the 2019 definitions of the SI units | joule second | a constant: 6.62607015e-34 J s, the value the reused De Broglie calculator already uses, so the two pages of this cluster cannot disagree. |
| m_e | Electron mass, also in the fixed line. Pinned to the live calculator’s own default rather than to the CODATA figure, which would differ in the fourth digit | kilogram | a constant: 9.109e-31 kg. |
The row worth reading twice is the visibility. It is the only readout on the panel that is not a number computed from a setting but a limit of the equation being plotted, and it is also the only one with just two possible values. Everything else on the panel is continuous in the sliders that drive it.
Everything to the right of the barrier is placed by one vertical map. A position on the screen in micrometres becomes a height in pixels, and both the marks and the predicted curve go through that same map. That is the single decision that makes the drawing arguable rather than decorative: the dots filling the curve is a claim, not a coincidence of two separately drawn pictures.
So the two halves of the drawing answer two different questions. One mark is a measurement — this electron, this position, whole and localised — and it carries no information about the stripes at all. The curve is a statement about probability, and it needs a sample before anything can be checked against it.
That is why the three-dot state matters more than the finished pattern. After three detections nothing on the screen distinguishes the two-slit prediction from the one-slit one. After twenty thousand, the bands and the empty gaps between them are the most obvious thing on the canvas, and no individual electron did anything different on the way.
The window the drawing plots is chosen, not fixed, and the caption says which rule chose it. Three envelope first zeros and eight fringe spacings are both reasonable framings, and the lab takes the narrower of the two so that the pattern always fills the strip. Because both figures move with the sliders, the rule that wins can change under you — which is why the figure is restated in micrometres on the axis every time.
The envelope deserves its own sentence, because it is the half of the picture that is not about interference. Each slit on its own spreads the beam, and that spreading sets a ceiling the fringes have to live under; the Envelope first zero cell is where that ceiling first touches zero. Fringes do not fade because the electrons get tired — they fade because the single-slit factor is falling.
The which-way result is the one the whole apparatus exists for, and the panel states it in the plainest way it can. One press, one number: 1.00 to 0.00. Nothing is dimmed and nothing is narrowed, and the envelope cell proves it by not moving — what the measurement removes is the modulation inside the envelope, not the envelope.
There is a reason that trade is so unforgiving rather than merely awkward. One press of the button does what tying each electron to an opening would do: it throws away the sideways momentum that put the fringes where they were, and the fringes have nothing left to stand on. The guide to the Heisenberg uncertainty principle sets that exchange out away from any particular apparatus, and the uncertainty principle lab lets you push on it directly.
Narrow the browser and the drawing gives things up in a fixed order rather than shrinking everything. The caption lines shorten first, then stop from the bottom upwards, so the mode line is the last thing to go and a strip that cannot hold it holds nothing at all. The window figure survives in the axis label in every form that is drawn at all, so the scale is never left unstated.
The lab solves its own model exactly, so nothing on the screen ever fails. Everything below is a limit of that model, of the slider grid, or of what a drawing a few hundred pixels wide can carry, and each item says what this lab does about it.
The topic itself — what wave-particle duality is, the evidence on both sides, where lambda = h / p comes from, what happens when you ask which slit, why everyday objects show no fringes, and seven problems worked end to end — is in Wave-Particle Duality: One Electron, Two Slits. If you would rather type a mass and a speed than drag a voltage, the de Broglie wavelength calculator runs the same relation in three directions.
The neighbouring questions have tools of their own. The de Broglie wavelength guide and its lab own the relation itself; the photoelectric effect guide with its lab and its calculator cover the half of duality that is about light; and the guide to diffraction alongside the diffraction lab covers the single-slit spreading that sets the envelope here.
Further out, the guide to the Heisenberg uncertainty principle is where the which-way trade is handled properly, the quantum mechanics overview places duality among the ideas it belongs with, and the photon energy formula guide with its calculator handles a photon rather than an electron. The rest is in the library of physics simulations and on the blog.
No — the stream starts itself when the page loads, so the Play button reads Pause stream and Electrons detected is already climbing. Nothing was missed, but the state worth seeing is the empty one. Press Reset: the dots and the count go to zero, the stream stops, and the button flips to Play stream. Now Fire 1 electron three times and watch Electrons detected read 1, then 2, then 3.
Because the whole argument of the lab is unreachable otherwise. At roughly 700 detections a second, several hundred dots land before anyone can reach Fire 1 electron, so a Reset that resumed the stream would make a screen with three dots on it impossible to see. Reset therefore clears the dots and the count, stops the stream and leaves all four sliders exactly where you had them.
Yes, and it is the cleanest single result in the lab. Fringe visibility falls from 1.00 to 0.00 and the first caption line changes from both paths open to path measured, while the other nine readouts hold: the wavelength, the fringe spacing, the momentum, the speed, the angle, the envelope zero, the maxima count and the slit ratio are all unchanged. Measuring the path removes the stripes, not the electrons.
No. It is computed from the intensity equation the lab plots, and the two values it can print, 1.00 and 0.00, are that equation’s ideal limits. An estimate taken from the dots would wobble with every frame while the physics stood still, because early on there are only a handful of them. A real which-way measurement decoheres only partly and would sit somewhere between the two.
Because the two come from different lengths. Fringe spacing is the wavelength times the screen distance divided by the slit separation, and the slit width is not in it. The width sets how far one opening spreads the beam on its own, which is the envelope. Drag Slit width a from 100 nm to 20 nm and Fringe spacing holds at 122.65 um while Envelope first zero goes from 613.2 um to 3066.2 um.
Because each card is computed from the exact value and rounded once. Take the printed 122.6 pm, multiply by 0.50 m and divide by 500 nm, and you get 122.6 um, whereas the card prints 122.65 um — it used the unrounded 122.6452 pm. Read each figure from the cell that publishes it rather than rebuilding it from a neighbour.
The drawing has to choose how much of the screen to plot, and it takes whichever of two candidate windows is narrower: three envelope first zeros, or eight fringe spacings. At the setting the lab boots in, eight fringe spacings wins and the caption reads window is +/- 981.2 um = 8 fringe spacings, the smaller of the two rules. Widen the slits to 200 nm and the other rule takes over.
No, and no browser could supply it. A fixed-seed generator places each mark, with the odds set so that the pile of marks settles onto the intensity curve the lab draws beside it. That is quantum randomness reproduced in distribution, not sampled from a quantum source. Because the seed never changes, the same sequence of clicks gives the same picture twice.