Home › Developer Tools › CSS Text Gradient Generator

CSS Text Gradient Generator

Design gradient text visually: drag color stops, set the angle or switch to radial and conic gradients, and preview on your own words and font. Copy clean CSS that uses background-clip: text with a solid-color fallback, plus HTML or Tailwind classes.

Last updated:

Presets
Gradient Text

Color stops

    Gradient

    
            

    Advertisement
    Advertisement

    How to use the CSS Text Gradient Generator

    1. Pick a preset such as Sunset, Ocean or Rainbow, or press Random.
    2. Edit the color stops: drag a handle along the bar, click the bar to add a stop, or change the color and position in the list.
    3. Set the direction with the angle slider, or switch the type to radial or conic.
    4. Type your text and choose font, size, weight and background to match your site.
    5. Copy the CSS (or HTML / Tailwind) and add the class to your heading.

    How CSS gradient text works

    CSS cannot fill text with a gradient directly, because color only accepts a single color. The trick is to paint the gradient as the element's background, then clip that background to the glyph shapes and make the glyphs themselves transparent:

    PropertyWhy it is needed
    background-image: linear-gradient(…)Paints the gradient behind the text
    -webkit-background-clip: textClips the background to the letters in Safari and older Chromium browsers
    background-clip: textStandard, unprefixed version (Firefox, Chrome 120+)
    -webkit-text-fill-color: transparentMakes the letter fill see-through so the clipped background shows
    color (fallback)A solid color used where clipping is not supported, so the text never disappears

    Linear, radial and conic gradient text

    • Linear gradients run along an angle: 90deg goes left to right, 180deg top to bottom, 0deg bottom to top. This is the classic choice for headings.
    • Radial gradients start in the center of the text box and spread outwards, which gives a glowing center on short words.
    • Conic gradients sweep around the center like a color wheel; repeat the first color at 100% for a seamless loop.

    Tips for good-looking gradient text

    • Use heavy weights (700–900) and large sizes: thin strokes show very little of the gradient.
    • Gradients clip to the element's box, so on a full-width heading the colors spread over the whole line. Use display: inline-block to fit the gradient to the words.
    • Keep enough contrast at both ends: the tool shows the lowest contrast ratio between any stop and the background. WCAG asks for 3:1 for large text and 4.5:1 for normal text.
    • Descenders such as g and y can be clipped on tight line heights; add a little padding-bottom if letters look cut.

    Frequently asked questions

    How do you make gradient text in CSS?

    Give the text a gradient background-image, clip that background to the shape of the letters with background-clip: text (plus -webkit-background-clip: text for Safari and older Chrome), and make the letter fill transparent with -webkit-text-fill-color: transparent or color: transparent. The gradient then shows only through the glyphs.

    Why do I need the -webkit- prefix?

    Chrome, Edge and Opera only support the unprefixed background-clip: text since version 120, and Safari still needs -webkit-background-clip: text. Including both lines covers every current browser.

    What is the fallback color for?

    If a browser cannot clip backgrounds to text, a transparent text color would make the text invisible. The generated CSS sets a normal solid color first and only switches to the gradient inside @supports, so older browsers and some email or print contexts still show readable text.

    Can I animate a gradient text?

    Yes. Make the background larger than the element (for example background-size: 200% auto) and animate background-position with @keyframes. Turn on Animate to get the code; it respects prefers-reduced-motion so users who disable motion see a still gradient.

    Does gradient text work with selection and accessibility?

    Screen readers read the text normally because only the paint changes. Check contrast at both ends of the gradient against the background, since light stops on a light page can be hard to read. Selected text may look different because the fill is transparent.

    Why does my gradient look cut off on multi-line text?

    By default the background covers the whole element, so each line shows only part of the gradient. Add box-decoration-break: clone (with the -webkit- prefix) on an inline element to repeat the gradient on every line, or keep gradient text to short headings.

    Are all the tools on FreeToolCabin tested for quality and accuracy?

    Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

    Related tools

    CSS Gradient GeneratorDesign linear, radial and conic CSS gradients with draggable stops and export CSS or PNG.CSS Text Shadow GeneratorLayer CSS text shadows with a live preview and neon, 3D, outline and retro presets.CSS Button GeneratorDesign CSS buttons with gradients, borders, shadows and hover and active states, then copy the code.CSS Animation GeneratorCreate CSS keyframe animations from 23 presets with live preview, timing controls and Copy CSS.Open Graph PreviewPaste OG tags and preview how links look on Facebook, X and LinkedIn.YouTube Embed Code GeneratorCreate responsive YouTube embed code with start time, autoplay, loop and privacy mode.CSS Box Shadow GeneratorDesign layered CSS box shadows with a live preview, presets and one-click Copy CSS.CSS Border Radius GeneratorRound each corner, draw elliptical 8-value radii or random blob shapes and copy the CSS.CSS Flexbox GeneratorBuild flexbox layouts visually: set container and item properties, then copy the CSS and HTML.Twitter Card GeneratorCreate X / Twitter Card meta tags with Open Graph fallbacks, character counters and a live preview.CSS Grid GeneratorDraw CSS grid layouts: set tracks and gaps, drag to name areas, then copy the CSS and HTML.PX to REM ConverterConvert px to rem or em and back, with a 1-100px table and a whole-CSS converter.Glassmorphism CSS GeneratorDesign frosted-glass UI cards with blur, transparency and border sliders, then copy the CSS.HTML Editor (Live Preview)Write HTML, CSS and JavaScript and see a live, sandboxed preview as you type.HTML to JSX ConverterConvert HTML to valid React JSX: className, htmlFor, style objects, self-closing tags and events.CSS Clip-Path GeneratorDraw CSS clip-path shapes by dragging points: polygons, circle, ellipse and inset. Copy the CSS.CSS Triangle GeneratorMake CSS triangles in 8 directions with the border trick or clip-path. Set size and color, copy CSS.CSS Loader GeneratorPick from 14 pure CSS spinners and loaders, set color, size and speed, then copy the HTML and CSS.Cubic Bezier GeneratorDrag the control points to design a CSS easing curve, compare it with linear and copy cubic-bezier().CSS Filter GeneratorAdjust blur, brightness, contrast, hue, sepia and drop-shadow on an image and copy the CSS filter.CSS Specificity CalculatorCalculate CSS selector specificity (a, b, c), including :is(), :not(), :has() and :where(), and compare.Google Maps Embed GeneratorTurn an address or coordinates into responsive Google Maps iframe embed code, no API key.Neumorphism CSS GeneratorDesign soft UI neumorphic shapes with live preview and copy the box-shadow CSS.SVG Wave GeneratorMake layered SVG waves for section dividers and export SVG, PNG or a CSS background.SVG Blob GeneratorGenerate random organic SVG blob shapes with gradients and export SVG, PNG or CSS clip-path.CSS Clamp GeneratorTurn min/max sizes and viewport widths into a fluid CSS clamp() value in rem and vw.CSS @font-face GeneratorTurn font files or URLs into ready-to-paste @font-face rules with weights, styles and a preview.CSS Media Query GeneratorBuild @media rules for widths, orientation, dark mode and hover, or get framework breakpoints.CSS Scrollbar GeneratorStyle scrollbars: width, colors, radius and hover, with ::-webkit-scrollbar and scrollbar-color CSS.CSS Sprite GeneratorPack many icons into one sprite sheet PNG and get CSS classes with background-position.CSS Toggle Switch GeneratorDesign pure-CSS toggle switches: size, colors, shape and animation. Copy accessible HTML + CSS.CSS Tooltip GeneratorBuild pure CSS tooltips: position, arrow, colors, padding and animation. Copy HTML and CSS.HTML Form BuilderDrag and drop form fields with labels and validation, then copy accessible HTML and CSS code.Iframe GeneratorCreate iframe embed code: size or responsive ratio, border, allow, sandbox, lazy load, live preview.PX to VW ConverterConvert pixels to vw and vh for any viewport size, and vw/vh back to px, with breakpoint tables.SVG Path EditorEdit an SVG path d attribute visually: drag points, edit commands, convert, scale and minify.SVG to CSS Data URITurn SVG code into a small URL-encoded data URI for CSS backgrounds, with Base64 size comparison.SVG to JSXTurn SVG code into a clean React component: camelCase attributes, style objects, TypeScript.CSS Background Pattern GeneratorMake pure-CSS stripes, dots, checkerboard, zigzag and grid backgrounds and copy the code.CSS Color Filter GeneratorTurn a HEX color into a CSS filter that recolors black icons and SVGs, with an accuracy score.CSS Gradient Animation GeneratorCreate animated gradient backgrounds: pick colors, angle and speed, preview live and copy the CSS.CSS Hover Effects GeneratorPick button, link and image hover effects, tweak colors and timing, and copy the HTML and CSS.CSS InlinerMove CSS from style blocks into inline style attributes so HTML emails render in every client.CSS Shape Divider GeneratorCreate wave, tilt, curve and triangle section dividers and copy the SVG, HTML and CSS.CSS Transform GeneratorRotate, scale, skew and translate an element with sliders and copy the CSS transform code.Font Pairing ToolPreview Google Font heading and body pairs on real layouts and copy the embed code and CSS.HTML Accessibility CheckerPaste HTML to find WCAG accessibility problems with impact level, the failing element and a fix.HTML Image Map GeneratorDraw clickable rectangle, circle and polygon hotspots on an image and get image map HTML.SVG ViewerOpen or paste SVG code to preview it live with zoom, backgrounds, size info and PNG export.Pathfinding VisualizerAnimate BFS, DFS, Dijkstra, A* and greedy search on a grid with walls, weights and mazes.Tailwind CSS Cheat SheetSearchable Tailwind class to CSS reference with live previews, class decoder and color palette.Web App Manifest GeneratorCreate a PWA manifest.json and every app icon size from one image, downloaded as a ZIP.
    See all 52 Web, HTML & CSS Tools →