This project is a lightweight browser-based network speed test implemented using Flask on the backend and vanilla HTML/CSS/JavaScript on the frontend. It measures ping (the round-trip time between the user’s browser and the server), jitter, packet loss, download speed, and upload speed.
A live version of this project is hosted on Render.com (server location: Frankfurt, Germany), and anyone can test it here:
👉 https://speedtestdemo.onrender.com/
When the user follows the link, a user friendly speed testing UI appears. When the push button is pressed, the internet speed information of the user is displayed. When the testing finishes, the upload speed is displayed in the middle of the website and all other results are displayed below.
project/
│ app.py
│ requirements.txt
│ README.md
│
└───static/
│ index.html
│ script.js
│ style.css
- Python 3.9+
- Flask 3.0.3
(Installed via requirements.txt)
No additional packages are required.
pip install -r requirements.txtStart the Flask server:
python app.pyThe server will run on:
http://localhost:5000
Open this URL in a browser to access the speed test interface.
The backend exposes lightweight endpoints:
| Endpoint | Purpose |
|---|---|
| / | Serves the UI (index.html) |
| /pg | Ping test — quick HTTP response ("pong") |
| /dw | Download test — returns a payload for download |
| /up | Upload test — accepts POST uploads to measure time |
| /server-info | Returns server IP, hostname and platform info |
| /path:filename | Serves other static files (JS, CSS, images, etc.) |
Located in static/:
index.html--- Main UI\script.js--- Logic for ping, download, upload measurements\style.css--- Styling
Frontend tests run in three phases: ping → download → upload.
The server is built using Flask because it is lightweight, easy to configure, and allows quick creation of multiple endpoints (/pg, /dw, /up, /server-info) with minimal dependencies. It runs in threaded mode (threaded=True) to handle multiple simultaneous requests from the frontend. Each download and upload test spawns 4 parallel fetch requests. Multithreading prevents bottlenecks and ensures accurate measurement.
The project is deployed and publicly accessible at:
https://speedtestdemo.onrender.com/
- Uses no external libraries other than Flask.
- Streaming download improves measurement realism.
- Multithreaded server enables parallel fetch requests.