CSS Loader Generator

Build CSS loading spinners with a live preview. Pick a style, adjust size, color, and speed, then copy ready-to-use CSS and HTML.

Preview Background
.loader { width: 60px; height: 60px; border: 6px solid rgba(5, 150, 105, 0.15); border-top-color: #059669; border-radius: 50%; animation: loader-spin 1s linear infinite; } @keyframes loader-spin { to { transform: rotate(360deg); } }
<div class="loader"></div>

No More GIFs or Icon Fonts

Loading spinners built with CSS stay sharp at any size, weigh almost nothing, and can be recolored in a click. Pick a style, tune it visually, and copy CSS that is ready to drop into any project.

How this CSS Loader Generator works

CSS loading animations rely on two building blocks: a shape drawn with borders, transforms, or box-shadow, and a @keyframes rule that moves it on a loop. Six loader styles are built into this tool, each using a different technique. Ring and Dual Ring use the border trick, coloring part of a circle's edge differently and spinning it with rotate. Dots and Bars stagger the same animation across several elements using animation-delay, so each piece moves a beat behind the last. Pulse scales and fades a single circle, and Ripple expands a ring outward while its opacity drops to zero, the same effect used for radar-style loading indicators.

Pick a style, then adjust size, color, thickness, and speed with the controls below the preview. Size changes the shape's overall dimensions, thickness controls border width on the ring-based styles, color updates every element in the animation at once, and speed sets how many seconds one loop takes, from quick and energetic to slow and calm. The preview background switcher lets you check how the loader reads against white, gray, and dark surfaces before you commit to a color, since a light-colored ring can lose contrast on a pale background.

Once it looks right, copy the CSS block, which includes the keyframes and the class rule, plus the small HTML snippet needed to render it. Nothing is uploaded; the loader is generated and rendered entirely in your browser.

How to use this CSS Loader Generator

1

Pick a loader style

Choose Ring, Dual Ring, Dots, Bars, Pulse, or Ripple from the style picker, and the preview switches to that animation instantly.

2

Adjust size, color, and speed

Drag the sliders to set size, thickness, and how fast the loop runs, or type a hex color to match your brand.

3

Copy the CSS and HTML

Copy the generated CSS block and the matching HTML markup, then paste both into your project.

Example Usage

A classic spinning ring loader, the most common pattern for inline loading states:

Input
Style: Ring, Size: 60px, Thickness: 6px, Color: #059669, Speed: 1s
Output
.loader { width: 60px; height: 60px; border: 6px solid rgba(5, 150, 105, 0.15); border-top-color: #059669; border-radius: 50%; animation: loader-spin 1s linear infinite; }

Frequently Asked Questions

What is a CSS loader and why use it instead of a GIF?
A CSS loader is a loading animation built from shapes and a @keyframes rule instead of an image file. It has no file to download, stays sharp at any screen size, and can be recolored or resized instantly with CSS, which a GIF cannot do without re-exporting the file.
How do I add this loader to my website?
Copy the CSS block and paste it into your stylesheet, then copy the HTML snippet and place it wherever the loader should appear, such as inside a button or over content that is still loading. The class name in both pieces already matches, so no extra setup is needed.
Can I change the loader color to match my brand?
Yes. Use the color picker or type a hex value, and every part of the animation, including the faint background ring on the Ring style, updates to match. The color is baked into the copied CSS, so you only need to edit it once here.
Why does my spinner look choppy instead of smooth?
Choppiness usually comes from animating a property the browser cannot handle efficiently, such as box-shadow position on every frame, or from a page that is too busy with other scripts. Every loader here animates only transform and opacity, which browsers can render smoothly even on lower-powered devices.
Do CSS loaders work without JavaScript?
Yes. The animation runs entirely through the CSS @keyframes rule and starts as soon as the element is visible in the page, so no JavaScript is required to play, pause on a timer, or loop it.
How do I show the loader only while content is loading?
This tool only generates the visual animation. In your own code, toggle the element with a small amount of JavaScript or your framework's conditional rendering, showing the loader div while a request is in flight and removing it once the data or page content arrives.
Are these loaders accessible to screen reader users?
The markup here is purely visual, so pair it with an aria-label such as "Loading" or a visually hidden text node on the parent element, and consider aria-live="polite" if the loader appears after a user action, so assistive technology announces the state change.
Will the generated CSS work in all browsers?
Yes. Every loader style uses border-radius, transform, and opacity animations, which have been fully supported in Chrome, Firefox, Safari, and Edge for many years. No vendor prefixes or fallbacks are required.
How do I make the loader bigger or smaller?
Move the Size slider. For the Dots and Bars styles, the individual dot size and bar width scale automatically with it, so the whole loader stays proportional instead of just stretching.
Does this tool store or upload the loaders I create?
No. The CSS and HTML are generated and rendered entirely in your browser using JavaScript. Nothing is sent to a server or saved anywhere unless you copy and paste the result yourself.

Related Tools

The CSS Loader Generator is maintained by CodeItBro. We aim to provide the best free developer tools on the web. If you have feedback or suggestions, please visit our contact page.

Comments

Questions, corrections, and useful tips are welcome. Comments are reviewed before publication.

Loading comments...

Comments are stored and moderated using Cusdis Cloud. Email is optional. Privacy Policy

As featured on

CodeItBro - Free dev tools + practical guides to help you ship faster | Product HuntCodeItBro - Free Online Developer Tools badgeCodeItBro badge