Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Web Tools
  3. CSS Gradient Generator
Add to favorites

CSS Gradient Generator

Design linear, radial and conic CSS gradients with live preview, vivid colour-space blending, and CSS or Tailwind code to copy.

Runs locally in your browserMore web toolsJump to full guide
Related readingCSS Animations: From Simple Transitions to Complex Keyframe Sequences11 minCSS Gradients: A Complete Guide to Linear, Radial, and Conic13 min

Initializing in your browser…

You might also like

CSS Button Generator

Design a CSS button with hover, pressed, focus and disabled states, each checked against WCAG contrast, and copy the CSS and HTML.

Color Picker

Pick a colour visually, from the screen or by typing it, and copy it in ten formats with contrast, the nearest name and colour blindness previews.

CSS Box Shadow Generator

Design layered CSS box shadows with live preview on light or dark, twelve presets, inset shadows, and a box-shadow line to copy.

CSS Gradient Generator: a worked example

A brand gradient from blue to orange shows a muddy pink band through the middle that neither colour explains.

The stops

#3b82f6 at 0%
#f97316 at 100%
Linear, 90 degrees
What CSS Gradient Generator produces

Colour kept through the middle, by blending space

sRGB     22%
OKLab    27%
OKLCH   100%

background: linear-gradient(90deg, rgb(59 130 246) 0.00%, ... 48 stops);
background: linear-gradient(in oklch 90deg, #3b82f6 0%, #f97316 100%);

Blended in sRGB, the default, the gradient runs on a straight line through the colour cube and its middle drifts toward grey, keeping only 22% of the colour of its ends; the pink band is that grey tinted by both colours. OKLab, often recommended, gets only to 27% here, because it is a straight-line space as well. OKLCH travels around the colour wheel from blue to orange instead of across it, so the middle stays fully saturated. The copied CSS has two lines: browsers that understand colour-space gradients use the second, and older ones use the first, which is the same ramp written as plain stops.

About the CSS Gradient Generator

Design a linear, radial or conic CSS gradient with live preview, then copy the CSS or a Tailwind class. You can also choose the colour space the browser blends in, and the tool shows how much colour survives through the middle, so you can avoid the dull grey band many gradients have.

Key features

  • Linear, radial and conic gradients with any number of colour stops
  • Angle slider and direction buttons, adjustable centre for radial and conic
  • Six blending spaces: sRGB, OKLab, OKLCH, CIELAB, CIELCH and HSL, with hue direction
  • A measure of colour kept through the middle, with a suggestion when another space does better
  • Worst-case contrast with white and black text across the gradient
  • CSS with an automatic fallback line for older browsers
  • An exact Tailwind arbitrary-value class
  • Reverse, random colours, eleven presets and shareable links

How to use

  1. 1Choose Linear, Radial or Conic and set the angle or centre.
  2. 2Set each colour with the picker or a hex code, and drag its position; press Add for more colours.
  3. 3Choose the colour space under Blend colours in if the middle looks dull.
  4. 4Open How the colours blend to check the colour kept and text contrast.
  5. 5Press Copy CSS or Copy class and paste it into your stylesheet or markup.

Making gradients that stay vivid

Build it. Choose Linear, Radial or Conic. Set the angle with the slider or one of the eight direction buttons, or for radial and conic gradients move the centre. Add as many colours as you like, type a hex code or use the colour picker for each, and drag its position along the gradient. Reverse flips the colours, Random colours tries new ones, and the presets give you a starting point. The preview is painted with exactly the CSS you copy.

Why some gradients look muddy. By default a browser blends colours in sRGB, drawing a straight line between them through the colour cube. Between two saturated colours on opposite sides of the colour wheel, that line passes close to the cube's grey centre, so the middle of the gradient turns dull. A blue (#3b82f6) to orange (#f97316) gradient keeps only 22% of its colour at its weakest point. Modern CSS lets you choose a different space with an interpolation hint, such as linear-gradient(in oklch 90deg, ...), and the tool writes that hint for you.

Which colour space to choose. OKLab is often recommended, but it is a straight-line space too, and for opposite colours it barely helps: magenta to green keeps 5% of its colour in sRGB and 5% in OKLab. OKLCH and the other polar spaces travel around the colour wheel instead, so colour does not have to fade: the same magenta to green keeps 57% in OKLCH, and the blue to orange pair keeps all of it. For polar spaces you can also choose which way round the wheel the colours travel, the short way or the long way for a rainbow. The tool measures every space for your colours and, when the current one loses a lot, names the one that keeps the most.

What the measurements tell you. Under How the colours blend, the ramp is shown as swatches with four figures: the colour kept through the middle, how far lightness runs backwards (which shows up as a band), and the weakest contrast against white and against black text. If text will sit on the gradient, a contrast of 4.5:1 or more is the WCAG minimum for body text.

Ready to paste. For a gradient blended in a modern colour space, the CSS includes a fallback line first: the same gradient written as 48 plain sRGB stops, so older browsers that do not understand the hint (Firefox before mid 2024, for example) still show the right colours. The Tailwind class is an arbitrary value that reproduces the gradient exactly in Tailwind 3 and 4. The page address keeps your settings so you can bookmark or share them. Everything runs in your browser.

Examples

  • A vivid brand gradient

    Blue #3b82f6 to orange #f97316 keeps 22% of its colour through the middle in sRGB. Switch Blend colours in to OKLCH and it keeps 100%, with no dull band.

  • A hero section with text

    Open How the colours blend before adding white text: if the weakest contrast with white is under 4.5:1, darken the lighter stop or add a dark overlay behind the text.

  • A colour wheel

    Choose Conic and press the Conic Wheel preset for a full hue circle around a centre point, useful for pickers and loading spinners.

Tips & best practices

  • Pick stops that are similar in lightness for a calm gradient, and different for a dramatic one.
  • For a rainbow, use OKLCH with the longer hue direction between two stops instead of six separate colours.
  • Keep a gradient behind text subtle, or check the contrast figures before you publish.
  • Bookmark the page after building a gradient: the address stores every setting.

Frequently asked questions

Why does my gradient have a grey or muddy middle?

Browsers blend in sRGB by default, and a straight line between two vivid, opposite colours passes through grey. Choose OKLCH (or another polar space) under Blend colours in, and the middle keeps its colour.

Do colour space gradients work in every browser?

The interpolation hint is supported by current Chrome, Edge, Safari and Firefox. For older browsers the copied CSS starts with a fallback line made of plain sRGB stops, which they use instead and which looks the same.

What is the difference between linear, radial and conic?

Linear blends along a straight line at an angle. Radial spreads outward from a centre in a circle or ellipse. Conic sweeps around a centre point like the hands of a clock, which suits colour wheels and pie-chart effects.

Which way does the angle go?

0 degrees points up and angles turn clockwise, so 90 degrees runs left to right and 180 degrees top to bottom, as in CSS.

How do I use the Tailwind class?

Paste it into the class attribute. It is an arbitrary value that contains the whole gradient, so it works in Tailwind 3 and 4 without any extra from- or to- classes.

Can I put text on the gradient?

Check How the colours blend first. It shows the weakest contrast between the gradient and white or black text; 4.5:1 is the WCAG minimum for normal text. If neither passes, add a semi-transparent overlay behind the text.

Related tools and how they differ

  • Color Picker: Picks and converts a single colour, with contrast checks, before you use it as a gradient stop.
  • Color Palette Generator: Builds a set of harmonious colours, a good source of stops for a gradient.
  • Glassmorphism Generator: Layers frosted glass over a background, which is often a gradient made here.

Further reading

  • CSS Animations: From Simple Transitions to Complex Keyframe Sequences11 min read
  • CSS Gradients: A Complete Guide to Linear, Radial, and Conic13 min read

Private by design

This runs as client-side JavaScript. Keys, tokens, payloads, and other inputs never leave your device.