CSS Gradient Generator
Free online css gradient generator for developers. Create linear/radial gradients visually. Fast and private.
background: linear-gradient(45deg, #ff6b6b 0%, #4ecdc4 100%);Embed this tool
Copy and paste the code below into your website to embed this tool for free. An attribution link to The Util Box is required.
<iframe src="https://www.theutilbox.org/embed/gradient-generator" width="600" height="500" frameborder="0" style="border: none; max-width: 100%;" title="Free CSS Gradient Generator tool from The Util Box"></iframe> <!-- Free tool by The Util Box — https://www.theutilbox.org/tools/gradient-generator --> <a href="https://www.theutilbox.org/tools/gradient-generator">CSS Gradient Generator by The Util Box</a>
Frequently Asked Questions about CSS Gradient Generator
CSS Gradient Generator — Linear, Radial and Conic
This CSS gradient generator builds a background declaration with
a live preview above the code. Choose the gradient type, pick two to five colours with the colour pickers or by
typing a hex value, and the CSS updates on every change. The output is a single line you can paste straight into
a stylesheet — no vendor prefixes, no framework classes, no build step.
The three types map to the three CSS gradient functions:
linear
linear-gradient(45deg, …) — a straight ramp along an angle. The angle slider
runs from 0° to 360°, where 0° points up and angles increase clockwise.
radial
radial-gradient(circle, …) — colour radiates from the centre. The angle
control is hidden here because a circular radial gradient has no direction.
conic
conic-gradient(from 45deg, …) — colour sweeps around the centre like a clock,
which is how pie-chart and colour-wheel effects are built.
Adding and Removing Colour Stops
The generator starts with two stops and lets you add up to five. Use + Add Color to append a stop and − Remove to drop the last one; the CSS and the preview update immediately, so you can judge a three-colour ramp as easily as a two-colour one. Beyond five stops a gradient starts to look muddy on small screens and the picker UI stops being readable, which is why the ceiling exists.
Two honest limits: the preview is a flat ramp with the stops you chose, and there is no control for stop
positions. The generator writes 0% on the first colour and
100% on the second, then leaves any further colours without a position, so the
browser spreads them evenly between those two endpoints — a third colour therefore lands at roughly the middle.
If you need a hard band at an exact offset such as 30%, add the percentage by hand to the generated value.
Why Gradients Beat Images
A gradient is resolution-independent: it stays perfectly smooth on a 5K display and costs a few bytes instead of the tens of kilobytes a background image would. It also inherits from CSS, so you can theme it with a custom property and swap it between light and dark modes without swapping assets. For hero backgrounds, card headers and button fills, a gradient is almost always the cheaper, sharper choice — reach for an image only when you need texture or a photographic blend.
Related CSS Generators
- Box Shadow Generator — layered shadows for cards and buttons.
- Border Radius Generator — independent corners for pill and blob shapes.
- Hex Color Gradient — interpolate between two colours to find intermediate hex values.
- Color Palette Generator — pick the colours before you gradient them.
Everything is generated locally in your browser.