Gradient Generator

Build a two-colour CSS gradient: pick the colours and the angle, see it live and copy the CSS. Your browser does the work.

Color ToolsTrending● Free No upload Instant

Loading Gradient Generator…

Your browser is preparing the tool. It runs 100% locally.

Quick answer

Choose two colours and an angle and the tool draws a linear gradient between them and gives you the CSS to paste, such as background: linear-gradient(135deg, #2563EB, #06B6D4). The angle is in CSS degrees, where 0 points up and 90 points right, rotating clockwise. It makes a two-colour linear gradient; for radial, conic or multi-stop gradients you would extend the CSS yourself. All of it happens in your browser.

What the Gradient Generator does

Pick your start and end colours, set the angle, and a live preview shows the gradient while the CSS updates beneath it. Copy the line and paste it into your stylesheet without writing the syntax by hand.

It produces a standard CSS linear gradient between two colours. The angle controls the direction the colours blend across, and the preview lets you tune it until it looks right.

How it works

The tool assembles a CSS linear-gradient function from your inputs: the angle in degrees followed by the two colours. It applies that as the background of the preview box and writes the same value into the CSS field for you to copy.

In CSS, the angle sets the direction of the blend: 0 degrees runs the gradient toward the top, 90 toward the right, and so on clockwise. With two colours and no explicit stops, the first sits at the start and the second at the end, blending evenly across.

Generation algorithm

  1. Read the inputs. Take the two colours and the angle.
  2. Build the CSS. Assemble a linear-gradient with the angle in degrees and the two colours.
  3. Preview it. Apply the gradient to the preview box.
  4. Output the CSS. Write the ready-to-copy background declaration.

What it outputs

background: linear-gradient(135deg, #2563EB, #06B6D4); 0deg points up · 90deg points right · clockwise from there

Two colours, blended across the angle; the first colour starts at one edge and the second ends at the other.

Technical details

Typelinear gradient (two colours)
AngleCSS degrees (0 up, 90 right, clockwise)
Outputready-to-copy CSS background
Stopstwo (start and end), no custom positions
Browser supportall modern browsers, no prefix
Where it runsIn your browser, nothing uploaded

Standards & references

  • CSS linear-gradient: the standard CSS function for a gradient along a straight line; the syntax is an angle followed by the colour stops, and it works in every modern browser without a vendor prefix.
  • Angle direction: 0 degrees points the gradient toward the top, 90 toward the right, 180 toward the bottom and 270 toward the left, increasing clockwise.
  • Two-colour, no stops: with two colours and no explicit positions, the first stop sits at the start (0%) and the second at the end (100%), blending evenly between.

Accuracy and limits

It makes a two-colour linear gradient. For a radial gradient (circular) or a conic gradient (around a point), or for three or more colours, edit the CSS it gives you. You extend it by adding more colour stops or changing the function.

The angle follows the CSS convention, which differs from a protractor: 0 degrees points up, not right, and angles increase clockwise. If the direction looks off, nudge the angle by ninety degrees.

It does not set custom colour-stop positions. The two colours sit at the start and end; to make one colour take up more of the gradient, add a percentage to its stop in the CSS.

The output is a single background declaration. Drop it onto an element; for a gradient behind text, make sure the text colour still has enough contrast over both ends.

Colours are whatever the pickers give, in hex. The gradient renders in the browser's standard colour space; very subtle banding can appear on large gradients, which is normal and not a fault of the CSS.

Where people use it

Backgrounds and buttons

Create a gradient background for a section, card or button.

Hero sections

Build an eye-catching gradient for a page header.

Quick design mockups

Try colour-and-angle combinations and copy the winner.

Learning CSS gradients

See how the syntax and angle map to the result.

When it fits, and when it doesn't

Good for

  • A two-colour linear gradient
  • Copy-ready CSS for backgrounds
  • Tuning colours and angle visually
  • Buttons, cards and hero sections

Not the best choice for

  • Radial or conic gradients (extend the CSS)
  • Three or more colour stops
  • Custom stop positions out of the box
  • Gradient text or complex masks

Need a radial, conic or multi-stop gradient? Start here and edit the CSS, or use a fuller gradient editor. Want a gradient on text? Combine the gradient with a background-clip technique in your own CSS.

Frequently asked questions

What does the angle do?
It sets the direction the colours blend. In CSS, 0 degrees points the gradient toward the top, 90 toward the right, and it increases clockwise, so 135 degrees runs diagonally toward the lower-right.
Why does 0 degrees go up, not right?
That is the CSS convention for gradients, which differs from a maths protractor. 0 points up and angles increase clockwise. If your gradient looks rotated, adjust the angle by ninety degrees.
Can I make a radial or conic gradient?
Not directly, because this makes a linear gradient. You can take the CSS and change linear-gradient to radial-gradient or conic-gradient, adjusting the syntax, since they share the colour-stop idea.
Can I use more than two colours?
The tool uses two, but CSS gradients support more. Copy the output and add extra colours (and optional percentage positions) between the two it gives you.
How do I make one colour take up more space?
Add a stop position in the CSS. For example, putting the first colour at 70% makes it dominate before blending into the second near the end.
Does it need vendor prefixes?
No. linear-gradient is supported across all modern browsers without a prefix, so the single declaration works as-is.
Where do I paste the CSS?
Onto the element you want the gradient on, as its background, for example in a class rule in your stylesheet, or inline. The copied line is the complete background declaration.
Can I put text over the gradient?
Yes, but check readability. A gradient changes colour across the element, so make sure your text has enough contrast over both the lightest and darkest parts.
Why does my gradient show faint bands?
Subtle banding can appear on large, smooth gradients because of the limited number of colour steps a screen can show. It is normal; a tiny amount of noise or a dithered image can hide it if needed.
Can I save the gradient as an image?
Not here. It outputs CSS, which is resolution-independent and suits the web. To get an image, apply the CSS and screenshot it, or use a design tool that exports.
Does the order of the colours matter?
Yes. The first colour starts the gradient and the second ends it, so swapping them reverses the direction of the blend (or you can change the angle instead).
Is anything uploaded?
No. Your browser generates the gradient and the CSS, and nothing is sent anywhere.

References

Builds a standard two-colour CSS linear gradient and outputs the ready-to-copy background declaration; it is explicit that the angle follows the CSS convention (0 degrees up, clockwise) and that radial, conic or multi-stop gradients need the CSS to be extended by hand.

PopularHot

Color Picker

Pick a colour and read it as HEX, RGB, HSL and CMYK.

ColorOpen
Popular

HEX to RGB Converter

A hex colour split into its red, green and blue numbers.

ColorOpen
Trending

Color Palette Generator

Analogous, complementary, triadic or monochrome sets from one colour.

ColorOpen
Editor's Pick

Contrast Checker

Pass or fail for text and background at each WCAG level.

ColorOpen

RGB to HEX Converter

Red, green and blue values packed into a #RRGGBB code.

ColorOpen

HEX to HSL Converter

Read a hex colour as hue, saturation and lightness.

ColorOpen

Back to the Gradient Generator

Every conversion happens in your browser. It's free, with no account.