CSS Gradient Generator
Build a linear, radial or conic CSS gradient with custom color stops and an angle, preview the result live, and copy the ready-to-paste background rule.
CSS Gradient Generator — Pick a gradient type, set the angle, and add as many color stops as you need — each with its own color and position percentage. A live preview box updates as you edit, and the ready-to-paste CSS background rule is shown for one-click copying. Everything runs entirely in your browser; no colors or CSS are ever sent to a server.
What is CSS Gradient Generator?
The CSS Gradient Generator is a free online tool for web designers and front-end developers who need a quick gradient without writing the syntax by hand. Choose a linear, radial, or conic gradient, set the angle in degrees for linear and conic types, and define color stops with a HEX color and a position percentage each. As you edit, a live preview shows the result and the matching CSS background rule updates instantly so you can copy it straight into a stylesheet. Use it to design buttons, hero backgrounds, cards, and overlays, or to learn how the linear-gradient(), radial-gradient(), and conic-gradient() functions work.
How to use CSS Gradient Generator
- Choose the gradient type: Linear, Radial, or Conic.
- For a linear or conic gradient, set the angle in degrees (0-360); radial uses a centered circle and ignores the angle.
- Edit each color stop: type or pick a HEX color and set its position as a percentage (0-100).
- Click Add stop to insert another color, or the trash icon to remove a stop (a minimum of two stops is kept).
- Watch the live preview box update, then copy the generated CSS background rule with the copy button.
Examples
Simple two-color linear gradient
Input
Linear, 90deg, #4f86f7 at 0% and #9333ea at 100%
Output
background: linear-gradient(90deg, #4f86f7 0%, #9333ea 100%);
Three-stop radial gradient
Input
Radial, stops #ffffff 0%, #4f86f7 50%, #1e3a8a 100%
Output
background: radial-gradient(circle, #ffffff 0%, #4f86f7 50%, #1e3a8a 100%);
Conic gradient for a color wheel
Switch the type to Conic, set the starting angle, and add several stops at evenly spaced positions to sweep colors around a center point — handy for pie-chart-like swatches or loading spinners.
Frequently asked questions
- Which gradient types are supported?
- Three: linear-gradient (with an angle in degrees), radial-gradient (a centered circle), and conic-gradient (with a starting angle). Switch between them with the type toggle and the CSS updates instantly.
- How do color stops and positions work?
- Each stop has a color and a position percentage from 0 to 100. Stops are written into the CSS in the order they appear in the list, exactly as the browser interprets them, so you control the order directly. You can add stops with Add stop and remove them down to a minimum of two.
- Can I pick colors visually instead of typing HEX?
- Yes. Click the small color chip next to each stop to open your browser's native color picker, or type a HEX value like #4f86f7 directly into the color field. The preview and CSS update as you change it.
- Why does the angle field disappear for radial gradients?
- A radial gradient here is drawn as a centered circle, which does not use an angle, so the angle field is only shown for linear and conic types where it changes the direction.
- Are my colors or CSS uploaded anywhere?
- No. The gradient is built entirely in your browser with local string and color math — no colors, CSS, or settings are ever sent to a server, so it works offline and keeps your work private.
Related tools
Code to Image
Turn a code snippet into a polished, syntax-highlighted PNG card in your browser, with a theme, gradient or transparent background, and padding — no upload.
Color Contrast Checker
Check the WCAG contrast ratio between a foreground and background HEX color and see whether it passes AA and AAA for both normal and large text.
Color Shades Generator
Turn one base HEX color into a Tailwind-style 50-950 shade scale, mixing toward white and black, each step with a swatch and copyable HEX.
CSS Box-Shadow Generator
Build a multi-layer CSS box-shadow with offset, blur, spread, color and inset controls, see a live preview, and copy the ready-to-use property.