CSS Gradient Generator
Create linear and radial CSS gradients with ready-to-copy code.
Design linear or radial gradients, preview them live and copy the CSS.
Loading the interactive tool… This page needs JavaScript to run the CSS Gradient Generator.
How to use CSS Gradient Generator
- Choose your colors or values.
- Preview the result live.
- Tweak until it looks right.
- Copy the CSS or code into your project.
How CSS Gradient Generator works
Choose linear, radial or conic, set the angle with the 0 to 360 degree slider, and pick two or three color stops. The tool outputs a ready background declaration and shows a live preview. Angle applies to linear gradients and as the starting angle of conic ones; radial gradients are drawn as a circle and ignore it. Colors are normalized to six-digit hex.
Worked example
Input type Linear, angle 90, two colors #ff0000 and #0000ff → Output background: linear-gradient(90deg, #ff0000, #0000ff); which runs from red on the left to blue on the right.
Common uses
- Making a hero banner background without exporting an image.
- Trying three-color sunset or brand gradients and copying the exact CSS.
- Creating a conic gradient for a simple pie-style or color-wheel effect.
Best for
- website backgrounds
- buttons and cards
- design prototypes
Tips for better results
- Use subtle angle changes for polished backgrounds.
- Check color contrast for accessibility.
- Test designs on light and dark backgrounds.
- Keep a copy of final values in your design system.
Frequently asked questions
Which browsers support CSS gradients?
All modern browsers support linear-gradient and radial-gradient.
How do I use the CSS?
Paste the generated declaration into a rule such as background on any element.
Is my data sent to a server?
No. This tool runs in your browser, so what you enter stays on your device.
Related tools
- CSS Border Radius Generator — Design rounded corners per corner and copy the CSS.
- CSS Clamp Generator — Create fluid font sizes with the CSS clamp() function.
- CSS Text Shadow Generator — Build CSS text shadows with a live preview.
- Glassmorphism CSS Generator — Create frosted-glass CSS with blur, transparency and border.
- Box Shadow Generator — Design CSS box shadows visually and copy the code.
- Color Palette Generator — Generate harmonious color palettes from a base color.