AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I create a CSS gradient?

Open AnyTool CSS Gradient Generator, pick a type — linear, radial or conic — set the angle or centre, then add colour stops and drag them along the track. A live preview updates instantly and you copy the ready-to-paste CSS (with a fallback colour and -webkit line), a Tailwind class or SVG. Everything runs in your browser; nothing is uploaded.

  • Linear (angle dial), radial (circle/ellipse, size, centre) and conic (rotation, centre) gradients
  • Add up to 12 colour stops; recolour with a picker or any hex / rgb() / hsl() value
  • One-click distribute, reverse and randomize; harmonious random gradients
  • Copy CSS, Tailwind arbitrary value or SVG; download .css, .svg and .png
  • 25 curated presets · 100% in your browser, nothing uploaded

What is

CSS Gradient

A CSS gradient is an image generated by the browser that transitions smoothly between two or more colours. linear-gradient() blends colour along a line at a given angle, radial-gradient() radiates from a centre point, and conic-gradient() rotates colours around a centre. Each colour stop sets a colour and a position (a percentage, or an angle for conic).

Generators

Related terms

linear-gradientradial-gradientconic-gradientColour stop

Frequently Asked Questions

Linear blends colours along a straight line at an angle, radial spreads them outward from a centre, and conic sweeps them around a centre like a colour wheel.

A linear-gradient transitions colours along a straight line whose direction you set with an angle (0deg points up, 90deg points right). A radial-gradient radiates outward from a centre point and can be a circle or an ellipse sized to the nearest or farthest side or corner. A conic-gradient rotates its colours around a centre point, so its stops are positioned by angle in degrees rather than by percentage — it is ideal for colour wheels and pie-chart effects. The AnyTool generator lets you switch between all three and remaps your stop positions automatically.

Each stop has a colour and a position. Linear and radial stops use percentages from 0 to 100; conic stops use angles from 0 to 360 degrees.

A colour stop pins a colour to a position along the gradient. For linear and radial gradients the position is a percentage (0% is the start, 100% is the end); for conic gradients it is an angle in degrees around the circle. If you place two stops at the same position you create a hard line — a crisp colour band instead of a smooth blend. The generator keeps stops sorted as you drag them, and you can add, remove, recolour, distribute evenly or reverse the whole set with one click.

No. The CSS, Tailwind class, SVG and PNG are all generated in your browser and nothing is uploaded, logged or stored.

AnyTool CSS Gradient Generator runs entirely in your browser. Your gradient is just a model of colours and positions; the CSS, Tailwind arbitrary value and SVG are strings built from it, and the PNG is rasterised locally on a canvas from that SVG. No colour data, image or settings are ever sent to a server, and the page works offline once cached.

conic-gradient has been baseline-supported in modern browsers since late 2020. For older browsers the exported CSS falls back to a solid colour.

conic-gradient() reached baseline support across Chrome, Edge, Firefox and Safari in November 2020, so it works in any up-to-date browser. linear-gradient and radial-gradient are supported everywhere. The exported CSS block from AnyTool always includes a solid fallback colour and a -webkit- line for very old WebKit, so legacy browsers degrade gracefully. Note that SVG has no true conic primitive, so an exported conic SVG or PNG is a high-fidelity approximation built from fine sampled wedges — always test in your target browsers.

Detailed Explanation

How It Works

Linear, Radial and Conic Gradients

The CSS Gradient Generator builds the three CSS gradient functions from a single editable model. linear-gradient() blends colours along a line set by an angle in degrees (0deg points up, increasing clockwise). radial-gradient() radiates from a centre point and can be a circle or ellipse sized with closest-side, closest-corner, farthest-side or farthest-corner. conic-gradient() rotates colours around a centre, with a "from" starting angle, so its colour stops are positioned by angle rather than percentage. Switching type remaps every stop position between the percentage (0–100) and degree (0–360) ranges automatically.

  • Three types: linear (angle), radial (shape + size + centre), conic (rotation + centre)
  • Linear angle uses CSS convention: 0deg = up, 90deg = right, clockwise
  • Radial size keywords: closest-side, closest-corner, farthest-side, farthest-corner
  • Conic stops are angular (0–360deg); linear/radial stops are percentages (0–100%)
  • Optional repeating-*-gradient for striped and ring patterns
Methodology

Colour Stops and Export Formats

Each colour stop pairs a CSS colour with a position. The editor supports up to twelve stops, recoloured with a native colour picker or by typing any hex, rgb() or hsl() value, dragged along a track, and kept sorted automatically. One-click actions distribute stops evenly, reverse the order or generate a fresh harmonious random gradient (analogous, complementary or triadic harmonies derived from a random base hue). Placing two stops at the same position creates a hard colour band. The same gradient exports as a CSS block (with a solid fallback colour and a -webkit- line), a Tailwind arbitrary value such as bg-[linear-gradient(...)], standalone SVG, and a PNG rasterised locally on a canvas.

  • Up to 12 stops; colour via picker or hex/rgb()/hsl() text input
  • Distribute evenly, reverse, and one-click harmonious randomize
  • Duplicate stop positions create crisp hard colour bands
  • Exports: CSS block (fallback + -webkit), Tailwind class, SVG, PNG
  • 25 curated presets covering linear, radial and conic styles
Privacy & Security

Privacy and Cross-Browser Fallbacks

All generation is client-side JavaScript: the gradient is a model of colours and positions, the CSS/Tailwind/SVG outputs are strings, and the PNG is drawn from the SVG on a local canvas, so nothing is uploaded, logged or stored and the page works offline once cached. linear-gradient and radial-gradient are supported in all browsers; conic-gradient has been baseline-supported since November 2020, and the exported CSS includes a solid fallback colour plus a -webkit- line for legacy WebKit. Because SVG has no native conic primitive, an exported conic SVG or PNG is a high-fidelity approximation made of fine sampled wedges, so users are advised to test conic output in their target browsers.

  • Everything runs in the browser — no upload, no server, works offline
  • PNG is rasterised from the SVG on a local <canvas>
  • conic-gradient baseline-supported across modern browsers since Nov 2020
  • Exported CSS includes a solid fallback colour and a -webkit- line
  • Conic SVG/PNG is a sampled-wedge approximation (no native SVG conic)
CSS gradient generation: in-browser (AnyTool) vs typical online generators
CapabilityAnyToolTypical online generators
Gradient typesLinear, radial and conicOften linear + radial only
ProcessingRuns in your browser, no CDNOften server-side / API
StopsUp to 12, picker + hex/rgb()/hsl(), drag to reorderUsually 2–4, basic pickers
Stop helpersDistribute, reverse, harmonious randomizeRare
Export formatsCSS (fallback + -webkit), Tailwind, SVG, PNGOften CSS only
Presets25 curated presetsVaries
Fallback / -webkitIncluded automaticallyOften missing
PrivacyNever uploaded, not stored, works offlineMay transmit or log
Cost / signupFree, no signupOften ad-heavy or gated

AnyTool composes every gradient locally in the browser and uploads nothing.