Widgets

How to Add a Wave on a String to Your Website

LK Forge · 4 min read · Updated September 2026

You can add a full wave-on-a-string simulator to any website, blog, or classroom page with a single line of code — free, with no sign-up, no plugin, and no script to install. Visitors send a pulse racing down a string and watch it bounce back, flip the far end between fixed and free to see the reflection turn upside down or stay upright, or drive the end steadily until the string locks into a shimmering standing wave. This guide covers the fastest way to embed the tool, what it teaches, and where it works.

The quickest way: paste one embed snippet

An embed is just an <iframe> that loads the simulator from lkforge.com, plus a small credit line. Copy this into your page’s HTML where you want the widget to appear:

<iframe src="https://lkforge.com/embed/wave-on-a-string/"
        width="100%" height="940" loading="lazy"
        style="border:0;max-width:560px"
        title="Wave on a String by LK Forge"></iframe>
<p><a href="https://lkforge.com/tools/physics/wave-on-a-string/">Wave on a String</a>
   by <a href="https://lkforge.com/">LK Forge</a></p>

The <iframe> is the live simulator; the <p> underneath is a plain credit link. Keep that line — the visible link is what keeps the widget free to embed. You can also copy this exact code straight from the LK Forge widget gallery.

What the widget shows

The simulator opens already driving the string, so a visitor sees the wave immediately and can then take control:

  • Pulse or oscillate: fire a single travelling pulse, or drive the end continuously to build a wave train.
  • Fixed or free end: toggle the far end and send a pulse to watch the reflection flip upside down at a fixed end and stay upright at a free one.
  • Wave speed, frequency, amplitude, damping: sliders change the physics live, so you can tune the string toward a resonance.
  • Standing waves and harmonics: at the right frequencies the string locks into fixed nodes and swinging antinodes, with dots marking each node.
  • Live readout: the panel reports the wavelength in cells, the harmonic number and the driving frequency, all obeying v = f·λ.

Pick the right height

The snippet uses height="940", which fits the string canvas, the mode and end toggles, the buttons, the sliders and the readout without clipping even on a narrow phone, where they stack into one column. On a wider page the widget centres within its max-width:560px. That single height works across screen sizes, so there is nothing to tweak for mobile.

Where it works

Because it is a standard iframe, the embed works anywhere you can add HTML:

  • WordPress: add a Custom HTML block and paste the snippet.
  • Squarespace: use a Code / Embed block.
  • Wix: add an Embed HTML / iframe element.
  • Ghost: insert an HTML card.
  • Notion: paste the /embed/wave-on-a-string/ URL and choose "Create embed".
  • Plain HTML, an intranet, or a lesson page: paste the snippet straight into the markup.

That’s the whole job. Copy the embed code from the widget gallery and paste it wherever a physics lesson or a blog post on waves, reflection, resonance or standing waves needs a string students can actually pluck and drive.

Grab the embed code from the LK Forge widget gallery — free, no sign-up.

Open the Wave on a String

Frequently asked questions

Is embedding the wave-on-a-string simulator free?
Yes. It is free to embed on any site, with no account, no API key and no usage limits. The whole simulation runs in your visitor’s own browser, so there is no server cost — we only ask that you keep the small "Wave on a String by LK Forge" credit line that comes with the embed code.
What can visitors do with the embedded simulator?
They can switch between Pulse and Oscillate modes, toggle the far end between fixed and free, send a single pulse, and reset. Sliders change the wave speed, driving frequency, amplitude and damping, and a readout reports the wavelength in cells, the current harmonic and the frequency.
Does the embed show reflection and standing waves?
Yes — those are the two teaching points. Send a pulse at a fixed end and it reflects inverted; switch to a free end and it bounces back upright. Drive the end continuously and, whenever a whole number of half-wavelengths fits the string, the outgoing and reflected waves lock into a standing wave with fixed nodes and swinging antinodes, marked by dots at each node.
What iframe height should I use, especially on mobile?
The snippet ships with height="940", which is tall enough that the string canvas, the mode and end toggles, the send-pulse and reset buttons, the sliders and the readout all fit without clipping even on a narrow phone, where the controls stack into a single column. On a wider page the widget simply centres within its max-width of 560px, so one height works across screen sizes.
Where can I embed it — WordPress, Wix, Squarespace, Notion?
Anywhere you can add HTML, because it is a standard iframe. In WordPress use a Custom HTML block; in Squarespace a Code/Embed block; in Wix an Embed HTML element; in Ghost an HTML card; in Notion paste the /embed/wave-on-a-string/ URL as an embed. On a plain HTML page or an intranet, paste the snippet straight into the markup.