Skip to content
Toolzy 100% free · no login

Home › Image & Design Tools › CSS Gradient Generator

CSS Gradient Generator

Runs in your browserFree · no sign-up

Pick a gradient type, set the angle and colour stops, and copy ready-to-use CSS. Start from a preset or build your own.

Colour stops

Advertisement

How to use this tool

  1. Start from a preset or choose Linear, Radial or Conic.
  2. Set the angle (or the shape and centre for radial and conic).
  3. Change colours and drag the stop positions; add up to five stops.
  4. Copy the CSS and paste it into your stylesheet.

Gradients in pure CSS

CSS gradients draw smooth colour transitions without any image file, so they load instantly, stay sharp on every screen and can be changed with one line of code. They are used for hero backgrounds, buttons, cards, text effects and loading placeholders. This generator writes the code for the three gradient functions supported by all modern browsers and shows a live preview as you adjust it.

Linear, radial and conic

  • linear-gradient blends colours along a straight line. The angle sets the direction: 0deg runs bottom to top, 90deg left to right and 180deg top to bottom.
  • radial-gradient spreads colours outward from a centre point, as a circle or an ellipse that follows the shape of the element. Move the centre to the top or a corner for a spotlight effect.
  • conic-gradient sweeps colours around a centre like a colour wheel or pie chart. Start and end with the same colour for a seamless loop.

Colour stops

Each stop is a colour and a position from 0% to 100%. Between stops the browser blends smoothly. Two stops at the same position create a hard edge, which is how stripes and progress bars are made. Stops are written in order of position, so you can drag them freely. Up to five stops keep gradients readable; most attractive gradients use two or three related hues.

Design tips

Gradients between colours that are far apart on the colour wheel can pass through a muddy grey middle. Adding a third stop with a bright in-between colour, or choosing neighbouring hues such as coral to amber or blue to violet, keeps the blend vivid. When text sits on a gradient, check the contrast at both ends with the colour contrast checker, because a gradient that is fine at one side may be unreadable at the other.

The code you get

The output includes a solid background fallback set to your first colour, followed by the gradient. Very old browsers and some email clients ignore the gradient and show the solid colour instead. Paste the two lines into any CSS rule, a style attribute or a design tool that accepts CSS.

Frequently asked questions

How do I make a CSS gradient?

Choose a type, set the angle and colours here, then copy the generated CSS into your stylesheet.

What angle goes left to right?

90deg goes left to right, 180deg top to bottom and 135deg diagonally from top-left.

How do I make hard stripes?

Put two colour stops at the same position to create a sharp edge instead of a blend.

Do gradients work in all browsers?

Linear, radial and conic gradients work in all current browsers. The output includes a solid colour fallback.

Can I use the gradient as text colour?

Yes. Set it as background, then add background-clip: text and color: transparent.

More free tools