CSS gradient generator

Build a gradient by dragging colour stops along a strip, set its angle, or start from a preset. Copy it as CSS or a Tailwind class for a website, or download it as a PNG or SVG background for slides, posts and phone wallpapers.

  • Free
  • No sign-up
  • Nothing uploaded
Loading the tool…
  • Linear, radial and conic
  • Up to 8 colour stops
  • CSS and Tailwind code
  • PNG and SVG downloads

How to make a CSS gradient

Four steps, start to finish.

  1. 1

    Pick a type

    Linear runs in one direction, radial spreads from the centre, conic sweeps around it.

  2. 2

    Set the colours

    Click a stop to change its colour, drag it to move it, click the strip to add one, up to eight.

  3. 3

    Angle and presets

    Drag the angle slider or tap a quick angle. Presets and Random give you a starting point.

  4. 4

    Copy or download

    Copy the CSS or Tailwind class, or save a PNG or SVG at a common screen or social size.

Three kinds of gradient

TypeWhat it doesGood for
LinearColours change along a straight line, at the angle you setBackgrounds, banners, buttons, overlays on photos
RadialColours spread out in a circle from the centreSpotlight effects, soft glows, focus behind a product
ConicColours sweep around the centre like the hands of a clockColour wheels, pie-like shapes, bold abstract backgrounds

Every gradient is a list of colour stops: a colour and a position from 0% to 100%. Between two stops the colour blends smoothly. Put two stops at the same position and the blend disappears, leaving a hard edge, which is how stripes and two-tone splits are made.

Reading the CSS

The generator writes the same code a browser understands, so what you see in the preview is what your website shows. A linear gradient looks like this: linear-gradient(135deg, #6366f1 0%, #ec4899 100%). The angle comes first, then each stop's colour and position.

  • Angles follow CSS: 0° points up, 90° to the right, 180° down and 270° to the left. 135° runs from the top left to the bottom right.
  • Radial gradients are written as a circle from the centre that reaches the farthest corner.
  • Conic gradients start at the angle you set and go clockwise all the way round.
  • The Tailwind class is the same gradient as an arbitrary value, such as bg-[linear-gradient(…)], with spaces turned into underscores the way Tailwind expects.

All current versions of Chrome, Edge, Firefox and Safari draw all three types, so the code works without prefixes.

Gradients that look smooth

  • Colours close on the wheel blend cleanly. Blue to purple, or orange to pink, stays bright all the way.
  • Opposite colours can turn grey in the middle. A blend from blue to orange passes through a muddy grey. Add a third stop in between, such as a purple or a pink, to keep it vivid.
  • Keep the lightness change gentle for backgrounds behind text, so the words stay readable from one side to the other.
  • Use transparency for overlays. A stop with low opacity, from the picker's opacity slider, fades a colour into whatever is behind it, which is how text is made readable over a photo.

Saving a gradient as an image

For places that don't take code, such as slides, social posts or a phone wallpaper, download the gradient as a picture. Choose a size first:

SizeFits
1920 × 1080Slides, desktop wallpapers, video backgrounds, YouTube
1080 × 1080Square social posts
1080 × 1920Stories, Reels and phone wallpapers
3840 × 21604K screens and large prints

PNG is a picture at exactly that size. SVG is a vector file that stays sharp at any size and can be edited in design apps; a conic gradient in the SVG is drawn as many thin slices, since SVG has no conic gradient of its own. To use one as the background of a design, upload the PNG into a design started from the templates, such as a social post or a presentation.

Very large, very gentle gradients can show faint steps (called banding) on some screens, because each colour channel has only 256 levels. Picking colours a little further apart, or adding a stop in the middle, usually hides it.

Save and share your gradient

The gradient is kept in the page's address as you edit, so copying the link shares the exact gradient and reloading the page brings it back. Everything is drawn in your browser: nothing is uploaded, and there is no account to make.

Updated

Gradient generator: common questions

What people ask before they use it.

Is this gradient generator free?

Yes, with no account and no limits. Use the CSS, the class and the images in any project, commercial ones included.

How many colours can a gradient have?

Between two and eight colour stops, each with its own position.

Can I make a transparent gradient?

Yes. Lower a stop's opacity in the colour picker. The CSS and PNG keep the transparency, which is useful for overlays on photos.

Why does the middle of my gradient look grey?

Colours from opposite sides of the colour wheel blend through grey. Add a stop in the middle with a colour between them, or pick colours closer together.

Does the gradient work in every browser?

Yes. Linear, radial and conic gradients are drawn by all current versions of Chrome, Edge, Firefox and Safari.