CSS Text Stroke Generator
Generate CSS outlined text using -webkit-text-stroke with custom stroke width, stroke color and fill color, plus a live preview and copy-ready CSS. Free, private.
Last reviewed by the Radiatus Cloud team
Need this done properly for your business?
Radiatus delivers secure cloud, DevOps & compliance engineering.
Outline text with CSS
Outlined text, where each letter is drawn as an outline rather than a solid fill, is a strong graphic effect for headings and a practical way to keep text legible over busy or unpredictable backgrounds. This generator produces the CSS using the text-stroke property, with a custom stroke width, stroke colour and fill colour, so you can create anything from a thin outline to a bold hollow display heading. It gives you a reliable version of an effect that is otherwise fiddly to get right by hand.
How the stroke works, and its quirk
The effect draws a stroke of your chosen width and colour around the edge of each individual letter. Combined with a transparent fill it produces genuinely hollow outlined text, or with a contrasting fill it produces solid text with a defined edge that stands out on any background. The property is vendor-prefixed and behaves slightly differently from browser to browser, so generating the CSS with the correct prefix and a sensible fallback in place is considerably more reliable than trying to write it correctly from memory each time.
Copy the CSS
It runs entirely in your browser, so nothing you enter is uploaded and the generated code is yours to paste straight into a project. Because it works client-side, you can iterate freely, regenerating as often as you like without a round trip to any server.
Related tools
- Color Converter — Convert colours between HEX, RGB, HSL, HWB and OKLCH, with alpha support. Runs in your browser and shows the live swatch for each format.
- Accessibility Color Contrast Checker — Check foreground and background colour contrast against WCAG thresholds, with the rules for text size, UI components and states.
- Typography Scale Generator — Generate a modular type scale from a base size and ratio, with fluid clamp() values for responsive layouts.
- Design Token Generator — Generate design tokens as CSS variables, JSON or platform formats, structured in the layers that make them maintainable.
Frequently Asked Questions
What does text-stroke do?
It draws an outline around each letter. With a transparent fill it makes hollow outlined text; with a contrasting fill it makes text stand out on busy backgrounds.
What can I customise?
The stroke width, the stroke colour and the fill, so you can make anything from a thin outline to a bold double-treated heading.
Why generate it rather than write it?
Because the property is vendor-prefixed and behaves slightly differently across browsers, so the generated CSS with the right prefix and fallback is more reliable.
Where does outlined text work best?
On large headings, and over busy images where a stroke keeps text legible. It is too heavy for small body text.
Is my input uploaded?
No. The generator runs entirely in your browser.
Privacy & Security
All processing happens locally in your browser — nothing is uploaded.
How to Use
Type text, set stroke width and colors, then copy the generated CSS.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
Color Converter
DesignConvert colours between HEX, RGB, HSL, HWB and OKLCH, with alpha support. Runs in your browser and shows the live swatch for each format.
Accessibility Color Contrast Checker
DesignCheck foreground and background colour contrast against WCAG thresholds, with the rules for text size, UI components and states.
Typography Scale Generator
DesignGenerate a modular type scale from a base size and ratio, with fluid clamp() values for responsive layouts.