PixConvert

Free CSS Gradient Generator

Build a gradient background with this free CSS gradient generator. Choose linear, radial or conic, set the angle and color stops, watch the preview and copy one line of ready CSS.

°

Color stops

0%
100%

CSS output

background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

How to Create a CSS Gradient

1

Pick a gradient type.

Choose Linear, Radial or Conic. For linear and conic, set the angle with the slider or type a number such as 90 for left to right.

2

Set the color stops.

Choose each color with the picker or type a code, drag its slider to place it, and use Add stop for more colors.

3

Copy the CSS.

The preview and code change with every edit. Click Copy CSS and paste the background line into your stylesheet or an inline style.

Frequently Asked Questions

Answers about angles, stops, transparency, browser support and using the code.

How do I make a gradient in CSS?

Use a gradient function as a background, for example background: linear-gradient(90deg, #ff6b6b 0%, #feca57 100%). Here you pick the type, angle and stops, and the tool writes that line for you to copy into your stylesheet.

Which angle goes left to right in a linear gradient?

90deg runs left to right. 0deg runs bottom to top, 180deg top to bottom and 270deg right to left. The default here is 135deg, from top left to bottom right. You can type any number, including negative values.

How do I make a gradient fade to transparent?

Type a transparent color into a stop's text box, such as rgba(255,255,255,0) to fade to clear white or rgba(0,0,0,0) for clear black. The code keeps it as typed. The color picker can't show transparency and shows black instead.

What is the difference between linear, radial and conic gradients?

Linear blends colors along a straight line at an angle. Radial spreads them out from a center point. Conic sweeps them around a center like a clock hand, which suits pie charts and color wheels. This tool draws radial gradients as a centered circle.

Can I change the shape or position of a radial gradient?

Not in the tool yet, since radial output is always radial-gradient(circle, ...) from the center. After copying, edit the code: change circle to ellipse, or write circle at 30% 20% to move the center. The stops stay the same.

Do CSS gradients need a -webkit- prefix?

No. Every current browser supports linear and radial gradients without a prefix, and conic gradients work in Chrome 69, Safari 12.1, Firefox 83 and later. This tool never adds prefixes, so the copied line is the standard syntax only.

How do I make hard color stops or stripes?

Put two stops at the same position. For example, #000000 at 50% and #ffffff at 50% gives a sharp line instead of a blend. Add more pairs to make stripes. The code sorts stops by position, and stops at the same spot keep the order you added them.

How many color stops can I add?

There's no limit. Add stop places a new stop halfway between the first stop and the one added last, so drag each new stop to where you want it. You can remove stops until two are left.

Can I use the gradient in Tailwind CSS?

The tool outputs plain CSS, not Tailwind classes. Paste the gradient into an arbitrary value with underscores for spaces, such as bg-[linear-gradient(135deg,#6366f1_0%,#8b5cf6_100%)], or add it to your theme as a background image.

How do I make gradient text with CSS?

This tool makes background gradients, but you can reuse the code for text. Put the copied background line on the text element, then add background-clip: text, -webkit-background-clip: text and color: transparent so the gradient shows through the letters.

Is the CSS gradient generator free and private?

Yes. It's free with no account or usage limit. Your colors and settings stay in your browser and aren't saved, so a reload starts over. On the live site, Google Analytics counts Copy CSS clicks, never the gradient itself.

CSS Gradient Generator: Types, Stops and Code

Three gradient types, any number of color stops, an angle control, a live preview and one line of CSS you can copy.

CSS gradient generator types: linear at 135deg, radial circle and conic from 135deg, from #6366f1 to #f59e0b to #ec4899

Build Linear, Radial and Conic Gradients

Switch between three gradient types. Linear and conic use an angle from 0 to 360 degrees, set with a slider or typed in. Radial always draws a circle from the center.

  • Linear, radial and conic types
  • Angle from 0 to 360 degrees
  • Radial is a centered circle
Try now
CSS gradient generator color stops #6366f1 at 0%, #ec4899 at 100% and #f59e0b at 50%, each with a slider

Add and Move Gradient Color Stops

Start with two stops and add as many as you need. Each stop has a color picker, a hex box and a slider that places it anywhere from 0% to 100%.

  • No limit on color stops
  • Positions from 0% to 100%
  • Remove stops down to two
Try now

Copy Ready-to-Paste CSS

Copy CSS gives one line, like background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); with stops sorted by position. No vendor prefixes are added, since current browsers don't need them.

Use Any CSS Color

The text box beside each stop takes any CSS color, not only hex. Type rgba(0,0,0,0), transparent, an hsl() value or a color name and it goes into the code as written.

Randomize for a Starting Point

Randomize picks one of six two-color pairs and a random angle. It replaces every stop you have, so use it before you fine-tune, not after.

Free, No Account Needed

Build as many gradients as you want without signing up. Colors and settings stay in your browser and reset when you reload. On the live site, Google Analytics counts Copy CSS clicks, never the code.

CSS Gradient Use Cases

Common places to paste a CSS gradient line.

Hero Backgrounds

Fill a landing page hero or section with a two- or three-color gradient. Set the angle so the lighter side sits behind your headline, then copy the background line.

  • Full-width hero and section banner backgrounds
  • Hard-edged section dividers with two stops at one spot
  • Fades to transparent, typed as rgba, for image overlays

Button & Card Styling

Give buttons, cards and badges a subtle fill. Pick two close shades of your brand color, keep the angle near 135 degrees and paste the line into the component style.

  • Primary button fills from two close brand shades
  • Card header accents with a short linear fade
  • Pie-chart style fills with a conic gradient

Brand Design

Turn brand colors into gradients for logos, app icons and social graphics. Type each brand hex code into a stop so the CSS matches your palette exactly.

  • Logo and app icon backgrounds in brand colors
  • Exact brand hex codes typed into each stop
  • One gradient line your whole team can reuse