UTILS.
Private by default
T○

CSS Text Stroke

Add an outline or stroke to text and copy the CSS.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

CSS Text Stroke Generator outlines lettering with the -webkit-text-stroke property. Type any text, then adjust the stroke width from 0 to 10 pixels in half-pixel steps and the font size from 20 to 160 pixels, and pick a stroke colour and a fill colour. A large preview shows the result immediately, drawn in extra-bold weight.

The copied CSS is a short rule: a .stroked class holding -webkit-text-stroke with your width and colour, color set to the fill colour, and font-size. The sample text is not part of the output, and neither are the font family or weight, so set those on your own element. Rename the class or move the three declarations into an existing rule.

The stroke is centred on each letter's outline, so half of its width falls inside the glyph and covers part of the fill. Thin strokes look like a crisp border, while thick strokes on a light font can swallow small gaps such as the inside of an e. For outline-only lettering the colour picker cannot choose transparent, so either pick the colour of the surface behind your text as the fill, or paste the CSS and change the color value to transparent yourself. Despite the vendor prefix, the property works in current Chrome, Edge, Safari and Firefox.

Frequently asked questions

Is -webkit-text-stroke widely supported?
Yes — despite the prefix it works in all current major browsers, including Chrome, Edge, Safari and Firefox.
How do I make hollow outlined text?
Set the fill colour to the colour of the surface behind the text so only the stroke remains visible. The picker here cannot choose transparent, so for truly see-through letters edit the copied color value to transparent.
Does the stroke width scale with the font size?
No. The width is written in pixels, so it stays the same when the text grows or shrinks. If your font size is responsive, change the value to em or rem in the copied CSS.
Why do my letters look bolder or filled in?
The stroke sits half inside the letter, so a wide stroke eats into the fill. Reduce the stroke width, use a heavier font weight, or enlarge the text.

More tools