CSS Gradient Generator
Design linear, radial and conic CSS gradients visually and copy the CSS or Tailwind classes.
.gradient {
background-color: #0ea5e9;
background-image: linear-gradient(90deg, #0ea5e9 0%, #8b5cf6 100%);
}linear-gradient(90deg, #0ea5e9 0%, #8b5cf6 100%)
bg-gradient-to-r from-[#0ea5e9] to-[#8b5cf6]
About this tool
A CSS gradient is an image the browser draws from a list of colors, so it scales to any size, needs no download and can be changed with one line of code. Gradients are used for hero backgrounds, buttons, progress bars, text effects and subtle surface lighting. CSS offers three kinds: linear gradients run along a line at an angle, radial gradients spread out from a center point, and conic gradients sweep around a center like the hands of a clock.
This generator lets you build all three visually. Drag color stops along the bar, click the bar to add new stops, adjust the angle or center, and turn on repeating mode for stripes and rings. The tool writes clean, standards-based CSS with a solid fallback color, and Tailwind CSS classes: simple gradients use the built-in bg-gradient-to-* utilities, and anything more complex uses an arbitrary value that works without changing your config.
How to use CSS Gradient Generator
- Choose Linear, Radial or Conic, or start from one of the presets.
- Click the color bar to add a stop. Select a stop to change its color, position and opacity, or drag it along the bar.
- Set the angle for linear and conic gradients, or the shape, size and center point for radial ones.
- Copy the full CSS rule, only the gradient value, or the Tailwind classes.
Examples
Two-color linear gradient
Linear, 90°, #0ea5e9 → #8b5cf6
background-image: linear-gradient(90deg, #0ea5e9 0%, #8b5cf6 100%); Tailwind: bg-gradient-to-r from-[#0ea5e9] to-[#8b5cf6]
Radial glow
Radial circle at 50% 40%, three stops
radial-gradient(circle at 50% 40%, #fde68a 0%, #f472b6 45%, #312e81 100%)
Hard-edged stripes
Repeating linear, 45°, two stops at the same position
repeating-linear-gradient(45deg, #e2e8f0 0%, #e2e8f0 10%, #94a3b8 10%, #94a3b8 20%)
When two stops share a position the color changes abruptly instead of blending, which creates stripes.
How gradient syntax works
- Linear: the angle sets the direction. 0deg goes from bottom to top, 90deg from left to right, 180deg from top to bottom. Keywords such as "to right" mean the same as 90deg.
- Radial: "circle" keeps the shape round; "ellipse" stretches it to the box. The size keyword (farthest-corner by default) decides where the last color stop ends, and "at x y" moves the center.
- Conic: colors sweep around the center starting at the "from" angle. A conic gradient with hard stops is an easy way to draw pie charts and color wheels.
- Each stop is a color plus an optional position. Without positions, stops are spread evenly. Positions may also be lengths such as 20px.
- Repeating versions tile the pattern defined by the stops. The last stop position sets the length of one repetition.
Tips for good-looking gradients
Gradients between two saturated complementary colors, such as blue and orange, often pass through a dull gray in the middle because the browser mixes colors in sRGB. Add a third stop with a bright in-between color, or keep the hues closer together. Modern browsers also support interpolation in other color spaces, for example linear-gradient(in oklch, …), which keeps the middle vivid.
For text on top of a gradient, check contrast against both ends of the gradient, not just the middle. A gradient with a transparent end (opacity 0) fades content into the background, which is useful for image overlays and scroll shadows. Always keep the solid background-color fallback: it shows while the page loads and in rare cases where the gradient is not supported.
Frequently asked questions
Everything you need to know about this tool and data security.
Can I use a CSS gradient as a border or on text?
Yes. For text, set the gradient as background-image, then add background-clip: text and color: transparent. For borders, use border-image with the gradient, or put the gradient on a wrapper with padding and an inner element with the normal background if you also need rounded corners.
Why does Tailwind sometimes get bg-gradient-to-r and sometimes an arbitrary value?
Tailwind’s gradient utilities only cover linear gradients at 45-degree steps with up to three colors at the default positions. Everything else, such as custom angles, radial or conic gradients and extra stops, is written as an arbitrary value like bg-[linear-gradient(100deg,…)], which Tailwind v3 and v4 compile without any configuration.
Are gradients bad for performance?
No. Gradients are drawn by the GPU and are usually cheaper than downloading an image. Very large animated gradients can cost repaint time, so animate opacity or transform of a gradient layer instead of the gradient colors themselves.
Is my data safe when using this tool?
Yes, 100% safe. This tool operates entirely inside your web browser using client-side JavaScript and WebAssembly. Your data never touches any external server.
Related Tools
Generate color harmonies and 50–950 shade scales from one color, then export CSS variables or a Tailwind config.
Build layered CSS box shadows with a live preview, plus neumorphism and glassmorphism styles.
Convert colors between HEX, RGB, HSL, HWB, OKLCH, HSV and CMYK, and check WCAG contrast.
Featured Projects tech-fun.net
Explore more AI & productivity tools
Nihongo GameBox
Master Japanese typing, Kana, and JLPT N5–N1 vocabulary through interactive retro arcade games.
ResumeGPT
Tailors CVs and cover letters to every job opportunity with a multi-agent LLM pipeline, job tracking, and scheduled discovery.
CollectMind
Turns your bookmarks into a searchable AI knowledge base — entirely on-device, powered by Chrome's built-in Gemini Nano.