CSS Gradient Generator
Create beautiful CSS gradients for free — no sign-up, no uploads, nothing to install. Choose between linear, radial, and conic types, add as many colour stops as you like, then copy the ready-to-paste CSS in one click. Everything runs right in your browser.
background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);Presets
How It Works
This free CSS gradient generator builds your gradient entirely inside your browser — nothing is ever sent to a server.
-
1. Pick a gradient type
Choose Linear for a straight directional fade, Radial for a circular or elliptical glow, or Conic for a sweeping colour-wheel effect. Each type gives you its own set of easy controls.
-
2. Set your colours
Click a colour swatch to open the browser's native colour picker, or type a HEX value directly. Drag the position slider to place each stop anywhere from 0% to 100%. Hit Add Stop to build richer, multi-colour gradients — remove any stop with the ×.
-
3. Adjust the gradient controls
Fine-tune the angle for linear gradients, or the centre point and shape for radial ones. The live preview at the top updates instantly as you drag — no buttons to press.
-
4. Copy the CSS or download as PNG
Click Copy CSS to place the complete
background:rule on your clipboard — ready to paste into any stylesheet, Tailwind config, or design tool. Or hit Download PNG to save a 1200×630 image generated locally by the browser's Canvas API.
Why users love this tool
- Instant live preview — see your gradient update in real time as you drag sliders, with no lag and no page reloads.
- Copy in one click — the full CSS property is ready to paste straight into your code, no editing required.
- Works offline — once the page has loaded, the tool works without an internet connection.
- Your data stays private — everything runs in your browser; nothing is uploaded or stored anywhere.
- Completely free — no account, no watermarks, no limits.
How It Works: Client-Side CSS Generation
The tool builds CSS gradient strings directly in the browser using standard DOM APIs — no external libraries or server calls required.
CSS linear-gradient(), radial-gradient(), conic-gradient()
React state holds your colour stops and control values. On every state change, a pure function
assembles the correct CSS gradient string, which is applied to the preview div via an inline
style attribute — no canvas needed for the preview.
Clipboard API for instant copy
Clicking Copy CSS calls the browser's navigator.clipboard.writeText()
API. An execCommand('copy') fallback handles older browsers to ensure broad compatibility.
Canvas API for PNG export
Downloading a PNG uses an offscreen HTMLCanvasElement (1200×630 px). The tool
maps your colour stops to a CanvasGradient (linear or radial), fills the canvas,
and calls canvas.toBlob() to create a Blob URL for the download — no server, no upload.
Zero dependencies, zero uploads
The component is pure React with no third-party gradient libraries. Colour stops, angles, and positions all live in local component state. Once the page loads, the tool works completely offline — your inputs never leave the browser tab.
Frequently Asked Questions
Does this tool upload anything to a server?
No. The CSS Gradient Generator runs entirely in your browser. No data — colours, settings, or generated images — is ever sent to any server.
What is the difference between linear, radial, and conic gradients?
A linear gradient transitions colours along a straight line at a chosen angle. A radial gradient radiates outward from a centre point in a circle or ellipse. A conic gradient sweeps colours around a centre point like a colour wheel or pie chart.
How do I add more colour stops?
Click the Add Stop button to insert a new colour stop. Pick any colour and drag the slider to place it between 0% and 100%. Remove a stop by clicking the × button — you need at least two stops to form a gradient.
Can I use the generated CSS in any framework?
Yes. The output is standard CSS3 that works in all modern browsers — Chrome, Safari, Firefox, Edge.
Paste it into a CSS file, a style attribute, Tailwind's arbitrary value syntax
(bg-[linear-gradient(...)]), or any design tool that accepts CSS.
What does the Download PNG button do?
It generates a 1200×630 pixel PNG image of your gradient using the browser's Canvas API and saves it to your device. The image is created locally — nothing is uploaded. This size is ideal for Open Graph (social share) images and design mockups.