5 new job openings added this week

CSS Gradient Generator

Design Tools Runs in your browser

Create beautiful CSS gradients visually with multiple color stops. Generate linear, radial, and conic gradients with instant preview.

Gradient Generator tool

Gradient Settings

0%
100%
CSS Code
background: linear-gradient(to right, #FF0000, #0000FF);

About Gradient Generator

Pick a gradient type, choose your colours, drag each stop to where you want it, and watch the preview update as you go. The CSS appears underneath as a single ready-to-paste <code>background</code> declaration. Add as many colour stops as you need, set a custom angle for linear gradients, and copy the result — it all runs in your browser.

What this tool does

  • Linear, radial and conic gradient types
  • Eight preset linear directions plus a custom 0–360° angle
  • Two or more colour stops, each with its own position from 0% to 100%
  • Live preview that updates on every change
  • One-line CSS output you can paste straight into a stylesheet
  • Copy to clipboard, and a reset back to the default two-stop gradient

Runs in your browser. This tool runs entirely in your browser using JavaScript. Nothing you enter or open here is uploaded to our servers.

How to use Gradient Generator

  1. Choose the gradient type

    Linear runs along a straight line, radial spreads out from the centre, conic sweeps around it like a pie chart.

  2. Set the direction

    For linear gradients, pick one of the eight presets or choose "Custom angle…" and drag the slider to any value between 0° and 360°.

  3. Choose your colours

    Click a swatch to open your system colour picker, and drag each stop's slider to position it along the gradient. Add Color Stop inserts another.

  4. Copy the CSS

    The generated declaration appears below the preview. Copy CSS puts it on your clipboard, ready to paste onto any element.

Gradient Generator examples

Real input and the output this tool produces for it.

Example inputs and the results Gradient Generator returns
Example Input Result
Simple left-to-right Linear, To Right, #FF0000 at 0%, #0000FF at 100% background: linear-gradient(to right, #FF0000 0%, #0000FF 100%);
Diagonal at a custom angle Linear, Custom angle 135° background: linear-gradient(135deg, …);
Radial glow Radial type background: radial-gradient(circle, …);
Hard stop Two stops both positioned at 50% A crisp two-colour split with no blend between them

Using CSS gradients well

The three gradient types

They differ in the shape the colours travel along, and each suits a different job.

CSS gradient types and what they suit
Type How colours travel Typical use
linear-gradient Along a straight line, in a direction or at an angle Hero backgrounds, buttons, section dividers
radial-gradient Outward from a centre point Spotlights, glows, soft vignettes
conic-gradient Around a centre point, like a clock face Pie and donut charts, colour wheels, sweep effects

How angles work in CSS

CSS gradient angles are measured clockwise from "up". 0deg points to the top, 90deg to the right, 180deg to the bottom, 270deg to the left. This trips people up because it is not the mathematical convention, where 0 points right and angles run anticlockwise.

The keyword directions are shorthands for exactly the same thing: to right is 90deg, to bottom is 180deg. Keywords also behave slightly differently on non-square boxes — to bottom right always points at the actual corner, whereas a fixed angle does not follow the box as it resizes.

Colour stops and hard stops

A colour stop is a colour and the position along the gradient where it sits. Between two stops the browser blends smoothly; the positions control where each colour is at full strength.

Two useful patterns come out of that. Putting two stops at the same position creates a hard stop — a crisp line with no blending, which is how gradient-based stripes and progress bars are built. And bunching several stops close together concentrates the transition in a narrow band, leaving broad flat areas either side.

A gradient between two very different hues will pass through muddy intermediate colours. Adding a stop in the middle at a colour you actually want steers it through better territory.

What this generator does not output

A few things are worth knowing before you paste the result into production CSS.

  • No vendor prefixes. Modern browsers have not needed -webkit- or -moz- gradient prefixes for years, but if you support very old browsers you will need to add them yourself.
  • No solid-colour fallback. Adding a plain background-color before the gradient line is good practice for anywhere the gradient does not render, and for readable text if it fails.
  • No transparency. Colours come from the browser's colour input, which is opaque six-digit hex. For a fade-to-transparent effect, edit the copied CSS by hand to use rgba().
  • Radial gradients are always circles. There is no ellipse, size or position control here — edit the copied declaration if you need ellipse at top left.
  • Conic gradients always start at 0deg. Change from 0deg in the copied CSS to rotate the sweep.

Keeping text readable on a gradient

Text over a gradient has to stay legible across the whole span, not just where you happened to check. A white heading that reads well over the dark end of a gradient can fail badly over the light end.

Check contrast against the lightest and darkest points of the gradient behind the text, and keep the range narrow where text sits. A semi-transparent overlay between the gradient and the text is the usual fix when the range has to stay wide.

When people use this tool

Hero and header backgrounds

A gradient gives a section depth without the page weight of a background image.

Buttons and calls to action

A subtle two-stop gradient makes a primary button read as raised.

Card and panel accents

A thin gradient strip along the top edge of a card is a cheap way to distinguish sections.

Overlays on images

Copy the CSS and switch the colours to rgba() to build a scrim that keeps caption text readable.

Charts and progress indicators

Conic gradients with hard stops render donut charts with no library at all.

Placeholder and empty states

A soft gradient block is a tidier placeholder than a flat grey box.

More about Gradient Generator

Create stunning CSS gradients with our visual gradient generator. Choose from linear, radial, or conic gradient types. Add multiple color stops with customizable positions, and see your gradient update in real-time. Control gradient direction for linear gradients, and customize angles. Copy the generated CSS code with one click. Perfect for web designers and developers who need custom gradients for backgrounds, buttons, or UI elements. The tool provides ready-to-use CSS code that you can paste directly into your stylesheets.

Gradient Generator — frequently asked questions

All Design Tools

Share This Tool

Help others discover this tool by sharing it on social media

Embed Gradient Generator on your site

Paste this iframe into your own page to give your readers the working tool without sending them away. The embed carries a "Powered by TechBelievers" link and needs no API key.

Embed code
<iframe src="https://techbelievers.com/tools/gradient-generator/embed?theme=light" width="100%" height="600px" title="Gradient Generator by TechBelievers" style="border:1px solid #e2e8f0;border-radius:0.5rem"></iframe>

Report a problem or suggest an improvement

Only used to reply to you about this report.

Join Whatsapp