CSS Gradient
CSS Gradient Generator
Pick colors and drag the stops on the bar to design a gradient for backgrounds and buttons. Choose linear or radial, set the angle or center, and copy the CSS code. Click the bar to add a stop.
Color stops
Click the bar to add a stop. Drag the markers to move them.
Presets
CSS
- Gradients written this way work in all current browsers, so -webkit- prefixes are not needed.
- For text on a gradient, check readability against both ends of the gradient with the Color Contrast Checker.
- A gradient with very similar colors can show visible bands on some screens. Adding a middle stop often helps.
About this tool
Design CSS linear and radial gradients with a live preview and copy the code. Add, remove and drag color stops, set opacity, angle, shape and center position, or start from presets such as Sunset, Ocean and Rainbow. Everything runs in your browser.
How to use
- Choose Linear or Radial under Type. For linear, set the Angle with the slider or the arrow buttons; for radial, pick the Shape and Center.
- Click the bar under Color stops to add a stop, and drag the markers to move them. Set the color, position and opacity of each stop in the list below.
- Start from a preset or Random if you like, and use Reverse to flip the order of the colors.
- Click Copy next to CSS and paste the code into your stylesheet. Tick the fallback option to add a solid background-color as well.
Useful for
- Creating backgrounds for hero sections and page sections
- Trying out color schemes for buttons, banners and headings
- Turning colors from a design mockup into CSS
- Making a transparent-to-color overlay so text stays readable on photos
FAQ
What is a CSS gradient?
A way to show a smooth transition between colors by writing linear-gradient() or radial-gradient() in the background property, without an image. It is lighter than an image and stays sharp at any size.
Do I need -webkit- prefixes?
No. The code this tool outputs works in all current major browsers.
Can I make a transparent gradient?
Yes. Each color stop has an opacity setting (0–100%), and semi-transparent colors are written as rgb(… / …%).
Does it support conic or repeating gradients?
No. The tool creates linear and radial (circle or ellipse) gradients only.
Need a website design that stands out?
From color schemes and banners to full websites, we design with your brand in mind.
Contact usUpdates to this tool
All updatesReleased 19 new tools, including find and replace, date and business-day calculators, a tsubo/m² converter, image cropping, transparent PNGs, .htaccess redirects, robots.txt and a timer, for 44 tools in total
Other free tools
All 183 free tools- Image Compressor (JPEG, PNG, WebP, AVIF)Shrink photos and screenshots, hit a target size in KB, compare before/after and download as ZIP.
- Image ConverterConvert between JPG, PNG, WebP, AVIF, GIF, BMP and ICO in bulk, with ZIP download.
- Watermark ImagesAdd a text or logo watermark to many photos at once, in 9 positions or tiled, at full size.
- Image ResizerResize images by pixels or percent, with presets for social media and batch resizing.
- Exif Viewer and RemoverView photo metadata such as GPS location and save a clean copy without it.
- QR Code GeneratorMake QR codes from URLs or text, choose colors and size, and save as PNG or SVG.
- Favicon GeneratorCreate favicon.ico, app icons and the <head> code from an image or text.
- Color Contrast CheckerCalculate the contrast ratio of text and background colors against WCAG.