UTILS.
Private by default
▤

CSS Gradient Generator

Build a linear or radial gradient with live preview and copy the CSS.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

Try a worked example

Example

Choose the linear type, set the angle to 135 and the colors to #ff7e5f and #feb47b. The CSS is background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);. Moving the first stop to 20 keeps the first color solid across the first 20% of the box.

Keep in mind

0deg points up and 90deg points right, so 135deg runs from the top-left corner to the bottom-right. If text sits on a gradient, check its contrast against both end colors.

About this tool

Build a two-colour CSS gradient visually and copy a ready-to-paste background declaration. The preview and the code are generated in your browser.

Choose Linear or Radial. A linear gradient has an angle slider from 0 to 360 degrees, where 0 points up, 90 points right (the default), 180 points down and 270 points left. A radial gradient is always a circle radiating from the centre, so the angle control is hidden. Pick the two colours with the colour inputs and place each one with its position slider, from 0 to 100 percent.

The output is a single line such as background: linear-gradient(90deg, #6366f1 0%, #ec4899 100%); with the colours written as 6-digit hex values. Press Copy to put that line on the clipboard.

There are exactly two colour stops: this is not a multi-stop editor, and it does not offer ellipse shapes, off-centre radial positions or transparency. Add extra stops by hand-editing the copied text. If the first position is higher than the second, the browser still renders it, but the stops cross, giving a hard edge. Nothing is uploaded.

Frequently asked questions

What is the angle in a linear gradient?
It sets the direction of the colour transition: 0 degrees points up, 90 degrees points to the right, 180 degrees down and 270 degrees to the left.
When should I use radial instead of linear?
Use radial to spread colour outward from a centre point, like a spotlight or glow. Linear blends along a straight line, which suits backgrounds and buttons.
Can I add a third colour?
Not in the tool; it has two stops. Copy the output and add more stops by hand, for example inserting a third colour with its own percentage.
What do the position sliders do?
They set where each colour is fully reached along the gradient line. Moving both inward leaves solid bands of colour at either end.

More tools