Dev Tools

Free Online CSS Gradient Generator

Create linear, radial and conic gradients with real-time preview. Copy the CSS directly. No sign-up.

#6d28d9
0%
#06b6d4
100%

CSS

background: linear-gradient(135deg, #6d28d9 0%, #06b6d4 100%);

background-image

background-image: linear-gradient(135deg, #6d28d9 0%, #06b6d4 100%);
background-size: cover;

Built by

Miguel Ángel Colorado Marin (MACM)

Full-Stack Developer · Guadalajara, España

I develop web apps, digital tools and full projects — from design to deployment.

Contact me

How to use the CSS gradient generator

  1. 1

    Choose the gradient type

    Linear for straight-line transitions, Radial to radiate from the center in a circular shape, Conic to rotate around a point like a pie chart.

  2. 2

    Configure the angle

    For linear gradients, drag the slider or use the quick angle shortcuts. The gradient updates instantly in the preview.

  3. 3

    Customize colors

    Click each color stop to change the hue. Adjust the position (%) of each stop with the slider. Add stops up to a maximum of 6 or remove them down to a minimum of 2.

  4. 4

    Copy the CSS

    The code is generated automatically below the preview. You can copy the background value or the background-image value depending on what you need.

CSS gradient types and generated code

Linear: linear-gradient(angle, stops). The angle goes from 0 to 360 degrees in steps of 1, with shortcuts every 45 degrees. 0deg points up and 90deg points right.

Radial: radial-gradient(circle, stops). The generator always uses a circular shape and offers no angle or size control. The radius reaches the farthest corner, which is the browser default.

Conic: conic-gradient(from angle, stops). The Start control rotates the starting point between 0 and 360 degrees. It suits pie charts and color wheels.

Stops: Between 2 and 6. Each one has a color and an integer position from 0% to 100%. If two stops share a position, a hard edge appears instead of a transition.

Order: In the code, stops are sorted by position, even when the list shows them in another order. When you add one, it is placed at the midpoint of the largest gap between stops, with a color mixed from its two neighbors.

Colors: The color picker always returns #rrggbb, without an alpha channel, so the interface cannot produce transparency. The generator does not write an in <color space> clause, so the browser decides how to interpolate.

Output: Two blocks are generated: background with the gradient, and background-image with background-size: cover. Each one has its own copy button. If the browser blocks the clipboard, a notice appears.

Presets: There are 12: Sunset, Ocean, Forest, Aurora, Fire, Midnight, Neon Pink, Mint, Radial Dawn, Conic Rainbow, Slate and MACM. Loading one replaces the type, angle and stops.

Example: With the default values the output is background: linear-gradient(135deg, #6d28d9 0%, #06b6d4 100%); which you can paste directly into your stylesheet.

Preview: The preview uses the same CSS value that gets copied, so what you see is what you get. Colors are picked with the browser's native picker, and its look depends on the operating system. Changes appear in the preview immediately, with no button to press.

Angle: All three types share the same stop list. The angle slider appears only for linear (Angle) and conic (Start), because radial does not use it.

Privacy: Everything is computed in the browser. The gradient and its code are not sent to any server, and nothing is saved between visits.

Frequently asked questions

What is the difference between a linear and a radial gradient?

A linear gradient (linear-gradient) transitions colors along a straight line defined by an angle. A radial gradient (radial-gradient) emits colors from a central point outward. This generator always uses a circular shape.

What is a conic gradient (conic-gradient)?

A conic gradient spreads colors around a central point, like the sectors of a pie chart. The Start control sets the angle where the sweep begins.

How many color stops can I add?

From 2 to 6 stops. Each one has a color picker and a position control from 0% to 100%, in 1% steps.

Is the generated code compatible with all browsers?

linear-gradient and radial-gradient work in modern browsers. conic-gradient requires Chrome 69+, Firefox 83+ or Safari 12.1+.

Can I use colors with transparency?

Not from the picker, which returns 6-digit hexadecimal values without an alpha channel. To add transparency, edit the generated code.

Can I use the presets as a starting point?

Yes. Click 'Presets' to see the 12 pre-designed gradients. Selecting one loads its colors, angle and type, which you can modify afterwards.

Related tools

Embed CSS Gradient Generator on your site

Add CSS Gradient Generator to any web page with a simple iframe. Free, with attribution to miguelacm.es.

<iframe
  src="https://miguelacm.es/embed/css-gradient-generator?locale=en"
  width="100%"
  height="700"
  frameborder="0"
  allow="clipboard-write"
  title="CSS Gradient Generator — miguelacm.es"
></iframe>
View embed in new tab →