#e2e8f0
48px
1.0s
// CSS OUTPUT
// pick a style and copy the css for any loading animation
Generate beautiful CSS loading spinners instantly. Pick a style, customize colors and size, then copy the pure CSS code — no JavaScript required.
Browse 20+ styles and click any card to select it and open the code panel.
Adjust color, size, and animation speed using the controls at the top.
Copy the CSS only, HTML only, or both at once — paste directly into your project.
A free online tool to generate pure CSS loading spinners. Pick from 20+ animation styles, customize the color, size, and speed, then copy the ready-to-use CSS into your project — no JavaScript required.
No. All spinners are 100% pure CSS using @keyframes animations. You only need a small HTML element and the CSS — no JavaScript libraries needed.
Yes. Some spinner styles use opacity variations and border tricks to create multi-tone effects from a single color. You can also manually edit the generated CSS to use different color values per element.
The generated HTML includes role="status" and aria-label="Loading..." attributes by default, which screen readers can announce. For reduced-motion users, wrap the animation in a @media (prefers-reduced-motion: no-preference) block.
All spinners use widely-supported CSS3 features including @keyframes, animation, border-radius, and transform. They work in all modern browsers: Chrome, Firefox, Safari, Edge, and Opera.
Wrap the spinner element in a container with display: flex; align-items: center; justify-content: center;. For full-screen overlays, add position: fixed; inset: 0; to the wrapper.
Yes. Use the Speed slider in the controls bar above to adjust from very slow (3s) to very fast (0.3s). The generated CSS reflects your chosen speed in the animation-duration property.
Add the spinner HTML inside your button element, then toggle a class with JavaScript to show or hide it. Set the button to position: relative and size the spinner small (16–20px) to keep it inline with the button text.
Yes. The output is clean, minimal CSS with no vendor prefixes needed for modern browsers. For older browser support, you can add -webkit- prefixes to the animation and @keyframes declarations.
A CSS loading spinner generator is a browser-based tool that lets you create animated loading indicators using pure CSS — without writing a single line of code by hand. You browse a library of pre-built animation styles, configure the visual properties (color, size, speed), and the tool generates the exact CSS and HTML you need to drop into your project immediately.
Loading spinners are a staple of modern web UX. Any time your interface is waiting for data — a form submission, an API call, a file upload — a spinner gives the user immediate visual feedback that something is happening. Without it, users are left guessing whether their action registered, often leading to repeated clicks and frustration.
Pure CSS spinners have a number of advantages over GIF animations, SVG-based loaders, or JavaScript-driven animations:
transform and opacity animations are handled by the browser's compositor thread, meaning smooth 60fps animation even on lower-powered devices.Loading spinners come in many visual styles, each suited to different contexts:
Once you've generated your spinner CSS, integrating it is straightforward:
<style> tag in your HTML file.element.classList.toggle('hidden').Loading spinners should always include accessibility attributes to communicate state to users who rely on assistive technologies. The generated HTML from this tool includes role="status" and aria-label="Loading..." by default. This ensures that screen readers announce the loading state without relying on the visual animation.
For users who have enabled the "Reduce Motion" setting in their operating system, consider wrapping the animation in a media query:
@media (prefers-reduced-motion: reduce) {
.spinner { animation: none; opacity: 0.6; }
}
This respects user preferences while still showing a static indicator that something is loading.
CSS animations are already highly performant, but here are a few practices to keep your spinners smooth:
transform and opacity properties — these are composited by the GPU and never trigger layout or paint.will-change: transform sparingly on spinner elements that animate continuously, as it signals to the browser to pre-optimize the element on the GPU layer.width, height, margin, or padding — these trigger expensive layout recalculations.display: none while keeping the animation running in the background.Loading spinners appear throughout modern web applications in many forms: