What Is a Particle Background Generator?
A particle background generator creates animated, interactive particle systems for web pages. Particles are small dots or shapes that float, drift, and optionally connect with lines — creating a dynamic, modern visual effect popular on tech company landing pages, portfolio sites, and SaaS homepages.
This tool lets you configure every parameter — particle count, size, speed, opacity, color, connection line distance, and mouse interaction behavior — then preview the result live and export a complete, dependency-free code snippet ready for production.
How to Use This Tool
- Set particle properties — Choose the number of particles, their size range, speed, opacity, and color. Start with 60–80 particles for a balanced look that performs well.
- Configure connections — Set the maximum distance at which particles draw lines between each other. Shorter distances create a more subtle network effect; longer distances create a dense mesh.
- Enable interactivity — Turn on Mouse repel to make particles move away from the cursor, and set the interaction radius.
- Export the code — Copy the generated HTML, CSS, and JavaScript. The output is a single self-contained snippet you can paste into any page.
Worked example: the exported snippet, before and after
The preview and the copied code now run the same function, so what you see is what you paste. On October 13, 2026 we pasted the old and the new export into the same page in Chromium 141 and measured them:
| Check | Before (v209 export) | Now |
|---|---|---|
| Canvas on a 2× (Retina) screen | 1280 px wide for a 1,280 px window: soft | 2560 px wide (device pixel ratio, capped at 2): sharp |
| Pointer repel with page content on top | no effect: the listener was on the canvas, which sits under the content | works: listens on the window (mouse, touch and pen via pointer events); the area round the pointer cleared |
| prefers-reduced-motion: reduce | 180 animation frames in 3 s | 0 frames: one still frame is drawn, and it animates again if the setting changes |
| Shape | always circles, whatever you picked | the shape you picked |
Main-thread cost, measured the way the previous version of this page did it (full-screen 1,280 × 800, DevTools Performance metrics over 3 seconds, script time / total task time):
| Particles | Before | Now |
|---|---|---|
| 80 (default) | 21 ms / 532 ms | 61 ms / 585 ms |
| 200 (slider maximum) | 75 ms / 1146 ms | 67 ms / 974 ms |
| 400 (edited code) | 412 ms / 2343 ms | 222 ms / 1790 ms |
Two changes cut the cost at higher counts: connection lines are found through a grid of cells one connect-distance wide, so each particle is compared only with its neighbours (300 random layouts gave exactly the same lines as comparing every pair), and particles and lines are drawn in a few batched paths instead of one path each, with line opacity in 8 steps. At 80 particles the grid's bookkeeping makes script time slightly higher; at 400 it is roughly half. Numbers vary from run to run by about 10%.
- The preview shows its frame rate. The counter in the corner of the preview reports frames per second on your device; on a phone, test with the particle count you plan to ship.
- Paused when hidden. Browsers stop requestAnimationFrame callbacks in background tabs and hidden iframes, so the loop costs nothing while the page is not visible.
- Interaction. Mouse repel pushes particles away from the pointer, including a finger on touch screens; there is no attract or follow mode.
Sources
Checked on .
Frequently Asked Questions
📖 Learn More
Related Article CSS Animation & Easing Guide → Related Article CSS Noise & Textures Guide →Built by Derek Giordano · Part of Ultimate Design Tools