Loading Spinner CSS Generator
A loading spinner shows visitors that a page, panel or button is still working. Set the size, ring thickness, color and speed below, watch the preview, then copy the finished loading spinner CSS into your stylesheet.
How to get your loading spinner CSS
-
1
Pick a size
Enter the diameter in pixels. Around 40 to 60 for a content area, smaller for inline use.
-
2
Choose thickness and color
Set the ring thickness in pixels and pick the color of the moving arc with the color field.
-
3
Set the speed
Enter the seconds for one full turn. 1 is a common default.
-
4
Copy the CSS
Use the copy button next to the CSS box and paste the rules into your stylesheet.
What you get
The generator writes two rules: a .loader class and a @keyframes spin block. The class draws a circle, gives it a light gray ring and colors the top edge of that ring. The keyframes turn the circle one full rotation, and the animation line repeats it forever. Nothing else is needed: no image file, no icon font and no script.
With the default values (60 px, 6 px ring, #10b981, 1 second) the output looks like this:
.loader {
width: 60px;
height: 60px;
border: 6px solid #eee;
border-top-color: #10b981;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
Add it to your page
Paste the CSS into your stylesheet, then add one empty element where the loader should appear:
<div class="loader" role="status" aria-label="Loading"></div>
Show the element while the work is running and remove it, or hide it with display: none, when the content arrives. The role and aria-label attributes let screen readers announce the state.
Sizes that work
| Where it sits | Size | Thickness |
|---|---|---|
| Inside a small button | 16 to 20 px | 2 px |
| Next to a line of text | 20 to 28 px | 3 px |
| Card or panel | 40 to 60 px | 4 to 6 px |
| Centered on an empty page | 60 to 100 px | 6 to 8 px |
A rule of thumb is a thickness of about one tenth of the diameter. Much thinner looks faint on high-resolution screens, and much thicker turns the ring into a blob.
Things to know
- The track color is fixed at light gray (
#eee). On a dark background, edit that value in the pasted CSS. - The tool makes one circular spinner. Dots, bars and other shapes need different markup.
- If a class called
loaderor an animation calledspinalready exists in your project, rename them in the pasted CSS so the rules do not collide.
Showing and hiding it
A loading spinner should appear when work starts and disappear when it ends. A simple pattern is to keep a hidden attribute on the element and remove it when a request begins. If the wait is usually very short, add a small delay of a few hundred milliseconds before showing the ring, so quick responses do not flash a spinner for an instant. Whatever you choose, always hide the spinner in the error case too, or visitors will wait for something that already failed.
Frequently Asked Questions
Yes. The output is plain CSS with one class and one keyframes rule, so it works in any stylesheet or style block, with any back end.
Keep the element hidden by default and show it when the request starts. Hide it again when the request finishes. You control that with a class toggle or a hidden attribute in your own code.
The generated CSS colors only the top border of the circle. When the circle rotates, that single colored arc travels around the light gray ring, which creates the spinning look.
Yes. Every value is a normal CSS property, so you can edit the width, border, color or animation time directly in your stylesheet.
Related Tools
Color Wheel Explorer
Explore the colour wheel interactively. Rotate harmonies, compare HSL vs RYB, spot complementary and triadic pairs in real time.
FPS Counter
Measure browser FPS with requestAnimationFrame, smoothing, min/max frame rate, warnings and an optional graph. Runs locally with no upload or API.
Placeholder Image Generator
Create a 1–4000 px placeholder with custom colors and text, download it as PNG, or copy a URL and HTML image tag.
Random Phone Number Generator
Generate 1 to 50 fictional phone numbers from officially reserved ranges for the US, Canada, UK, Australia or Germany.
GitHub Profile README Generator
Build the README.md for your GitHub profile page (the username/username repo) with tagline, skills, stats cards and language breakdown.
Color Palette Generator
Generate monochromatic, analogous, complementary, triadic or tetradic color palettes from a base HEX color and export copy-ready CSS variables.
Tool available in other languages
- เครื่องมือสร้างสปินเนอร์โหลด CSS [TH]
- Generator CSS spinera ładowania [PL]
- Trình tạo CSS loading spinner [VI]
- Generator CSS Loading Spinner [ID]
- مولّد CSS لدوّامة التحميل [AR]
- Lade-Spinner CSS Generator [DE]
- ローディングスピナー CSS ジェネレーター [JA]
- Gerador de CSS para spinner de carregamento [PT]
- Generador de CSS para spinner de carga [ES]
- 로딩 스피너 CSS 생성기 [KO]
- Generator för laddningsspinner i CSS [SV]
- Générateur de CSS pour spinner de chargement [FR]
- CSS-laadspinner generator [NL]
- Generatore di CSS per spinner di caricamento [IT]
- Генератор CSS для индикатора загрузки [RU]
- Yükleme Spinner CSS Oluşturucu [TR]
- 加载动画 CSS 生成器 [ZH]