Skip to content
toolgrid

No tool found. Try another word.

CSS Text Style Generator

Style text visually (font, size, weight, line height, letter and word spacing, case, decoration, alignment and colour) and copy the CSS.

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the CSS Text Style Generator

  1. 1 Type a preview text.
  2. 2 Adjust the font, sizes, spacing, case, decoration, alignment and colour.
  3. 3 Copy the generated CSS.

About the CSS Text Style Generator

Good typography is mostly about a few properties: font-family, font-size, font-weight, line-height and letter-spacing. This generator lets you change them with sliders and see the effect immediately, then gives you clean CSS with only the properties you changed from the defaults.

A line height of about 1.4 to 1.6 works well for body text; headings look better tighter, around 1.1 to 1.25. Uppercase text and small sizes are easier to read with a little extra letter spacing (0.02–0.1em), while large headings often look better with slightly negative spacing.

Text decoration has more options than a plain underline: dotted, dashed, double and wavy lines, which you can combine with the decoration colour in your own stylesheet. Use underlines mainly for links, so people recognise them.

Frequently asked questions

What is a good line height?

For paragraphs 1.4–1.6 times the font size; for headings 1.1–1.25. Longer lines need a bit more line height.

Should letter spacing be in px or em?

In em, so it scales with the font size: 0.05em is the same proportion at every size.

What does text-transform capitalize do?

It shows the first letter of every word as a capital, without changing the text itself. Screen readers and copy-paste still use the original text.

Why doesn’t my font change?

The font isn’t installed on your device. Use a web font (for example from our Google Fonts previewer) to make sure everyone sees the same font.