Skip to main content

CSS Gradient Generator

Create linear, radial, and conic CSS gradients with a visual editor.

How it works

  1. 1

    Choose a gradient type

    Select linear, radial, or conic. Start from a preset or build from scratch.

  2. 2

    Adjust color stops

    Add, remove, and position color stops. Pick colors with the color picker or enter hex values.

  3. 3

    Copy the CSS

    Copy the generated CSS property and paste it into your stylesheet.

Common use cases

  • Two-tone linear

    #6366f1 at 0%, #ec4899 at 100%, 135°

  • Three-stop radial

    #ef4444, #f97316, #eab308 (circle)

About This Tool

Design beautiful CSS gradients with a live visual editor. Choose between linear, radial, and conic gradient types. Add up to 10 color stops, adjust their positions along the gradient, and fine-tune the angle (for linear/conic) or shape (for radial).

The large preview panel updates in real time as you adjust controls. Start from six built-in presets (Sunset, Ocean, Forest, Royal, Fire, Night) or build from scratch. For two-stop linear gradients, the tool also generates an approximate Tailwind CSS class.

The output is a copy-ready CSS background property that works in all modern browsers. No vendor prefixes needed — linear-gradient, radial-gradient, and conic-gradient have full browser support.

Every gradient you design stays in your browser — no data is transmitted anywhere.

Linear gradients transition colors along a straight line defined by an angle. A 0deg angle goes bottom to top, 90deg goes left to right, 180deg goes top to bottom (the default), and 270deg goes right to left. You can also use directional keywords like to top right for diagonal gradients. Linear gradients are the most common type and work well for backgrounds, buttons, overlays, and hero sections.

Radial gradients transition colors outward from a center point in a circular or elliptical shape. The circle shape creates a round gradient, while ellipse stretches to fill the element proportions. You can control the center position with keywords or exact coordinates. Radial gradients are excellent for creating spotlight effects, vignettes, and ambient lighting backgrounds.

Conic gradients transition colors around a center point in a rotational sweep, like a color wheel. They are perfect for pie charts, color wheels, sunburst patterns, and unique decorative elements. Conic gradients were added to CSS later than linear and radial but now have full browser support.

Color stops define the colors and their positions within the gradient. Each stop has a color value and an optional position percentage. Positions can overlap for sharp transitions, or spread out for smooth blends. Using three or more stops creates more complex gradients that can simulate lighting, depth, and atmospheric effects.

Tips for effective gradients: Limit your palette to 2-3 colors for clean, professional designs. Use analogous colors (nearby on the color wheel) for harmonious gradients. Add a very dark or very light stop at one end to create depth. Avoid using too many stops — simplicity usually looks better. Test your gradient on both light and dark screens, as perception changes significantly with surrounding brightness.

Performance considerations: Gradients are rendered by the browser GPU and are generally more performant than background images. They scale infinitely without quality loss and add zero download weight. For animated backgrounds, consider using CSS animations to shift the background-position of a gradient, creating a subtle shimmer or movement effect.

When combining gradients with other CSS features, you can layer multiple backgrounds using commas. For example, a semi-transparent gradient overlay on top of a background image creates a text-readable hero section: background: linear-gradient(rgba(0,0,0,0.5), transparent), url(image.jpg).

More examples

Examples

Two-tone linear

Input

#6366f1 at 0%, #ec4899 at 100%, 135°

Output

background: linear-gradient(135deg, #6366f1 0%, #ec4899 100%);

Three-stop radial

Input

#ef4444, #f97316, #eab308 (circle)

Output

background: radial-gradient(circle, #ef4444 0%, #f97316 50%, #eab308 100%);
Frequently Asked Questions
What gradient types are supported?
Linear (directional), radial (center-outward, circle or ellipse), and conic (sweep around a center point). All use standard CSS syntax supported by every modern browser.
Do I need vendor prefixes?
No. linear-gradient, radial-gradient, and conic-gradient are fully supported in all modern browsers without prefixes (Chrome, Firefox, Safari, Edge). The -webkit-gradient syntax was deprecated over a decade ago.
Can I generate Tailwind gradient classes?
For simple two-stop linear gradients, the tool generates an approximate Tailwind class. Complex gradients should use the CSS output directly in a custom style or @apply directive. Tailwind supports gradient from/to/via modifiers that cover most common cases.
How many color stops can I add?
Up to 10 color stops per gradient. Most designs use 2-4 stops. Each stop has a configurable color (via picker or hex input) and position percentage. You can create sharp transitions by placing stops at the same position.
How do I create a sharp color transition?
Place two color stops at the same position percentage. For example, blue 0%, blue 50%, red 50%, red 100% creates a hard line between blue and red at the midpoint. This technique is useful for striped backgrounds and geometric patterns.
What is the difference between radial and conic gradients?
Radial gradients transition colors outward from a center point in concentric circles or ellipses. Conic gradients transition colors rotationally around a center point, like the hands of a clock. Use radial for spotlight effects and conic for pie charts and color wheels.
Can I animate a CSS gradient?
CSS cannot directly animate between gradient stops, but you can animate the background-position or background-size of a gradient to create movement. Another approach is to use a larger gradient and animate its position for a smooth scrolling effect.
How do I overlay text on a gradient?
Apply the gradient as a background on the container element. Ensure sufficient contrast between the text color and all parts of the gradient. You can add a semi-transparent overlay gradient on top to darken or lighten areas where text appears.

Learn More

Related Guides

Discover More Tools

View all Design Tools →