Free tools that run in your browser. Use any tool without an account.

Favourites Cart
Sign in
Join free

CSS Gradient Generator

  • Free
  • Runs in your browser
  • No account needed

FreeToolr's CSS Gradient Generator creates linear or radial gradients with up to 5 colours. Set an angle and stop positions, preview the result live, then copy CSS such as linear-gradient(90deg, #2563eb, #8b5cf6).

Runs in your browser. Your files and values are not sent to us. Report a problem
Advertisement

About the CSS Gradient Generator

FreeToolr's CSS Gradient Generator helps developers, designers and students create CSS backgrounds without writing gradient syntax by hand. Choose a linear or radial gradient, add up to 5 colours, set stop positions and adjust the angle for linear designs. The preview updates as you change the inputs. The tool returns copyable CSS with a fallback colour, so you can place it directly in a stylesheet. It runs in your browser, with nothing to install and no files uploaded. The focused controls keep common gradient work quick while still showing the exact colour stops and direction. Use it for page backgrounds, cards, buttons, banners and other CSS elements that accept background images.

How to use it

  1. 1Choose a linear or radial gradient type.
  2. 2Set the colours, using up to 5 colour stops.
  3. 3Enter the angle for a linear gradient, or adjust the radial settings shown by the tool.
  4. 4Set each stop position to control where colour changes occur.
  5. 5Copy the generated CSS and use the fallback colour in your stylesheet.
Advertisement

Worked example

Choose Linear, enter 90deg, set #2563eb at 0% and #8b5cf6 at 100%. The result is: background: #2563eb; background: linear-gradient(90deg, #2563eb 0%, #8b5cf6 100%);

How it works

1Resolve each colour stop to a positionIf the first stop has no position, use 0%If the last stop has no position, use 100%Missing positions between specified stops are distributed evenly2For a sample position p between stops p1 and p2, calculate t = (p - p1) / (p2 - p1)3Convert both colours to the selected interpolation colour space4If alpha is involved, use premultiplied-alpha components5Interpolate each component: C(p) = (1 - t) x C1 + t x C26Convert the result back to the required output colour space and render it7For hard stops, use equal positions or adjacent stops at the same position8For repeating gradients, the stop interval is tiled across the gradient box

Source: W3C CSS Images Module Level 4W3C CSS Color Module Level 4MDN: Using CSS gradients. Last checked 4 November 2026.

What it is good for

  • Create linear or radial CSS gradients with up to 5 colours.
  • See changes instantly in a live preview.
  • Copy CSS with a fallback colour for broader browser support.
  • This tool creates linear and radial gradients only, with a maximum of 5 colours.
  • A gradient has no text meaning by itself, so check text contrast and provide meaningful labels where needed.
Advertisement

Questions people ask

What is a CSS gradient?

A CSS gradient is a browser-generated image that transitions between two or more colours. You can use it with background and other CSS properties that accept images.

How do I make a linear gradient?

Choose Linear, enter an angle, then set your colours and stop positions. For example, linear-gradient(90deg, #2563eb, #8b5cf6) changes from blue to violet across the element.

How do I make a radial gradient?

Choose Radial, set the colours and adjust the available radial controls. The colour transition spreads outward from a central point instead of following a straight line.

What is a colour stop?

A colour stop combines a colour with its position in the gradient. For example, #f00 20% places red at the 20 percent point.

What does 0deg mean in a linear gradient?

A 0deg linear gradient points upward. The first colour appears at the bottom, and the final colour appears at the top.

Can I create a hard stripe instead of a smooth transition?

Yes. Give two adjacent colour stops the same position, such as red 50% and blue 50%. This creates a sharp change instead of a blended section.

Can CSS gradients use transparency?

Yes. Use a colour with an alpha value, such as rgb(0 0 0 / 0), when you need transparency. Check the result against its background before publishing.

Help keep every tool free

FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.

Advertisement
Advertisement