CSS Letter Spacing & Line Height Generator
Font
Size & unit
Spacing
(margin-top, em) 0.75em
Presets

Heading H1 — nice typographic rhythm

Lead text example. Adjust the spacing, then copy the CSS for your projects.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat, magnam. The text in this preview is here to show how letters, word spacing, and line height behave at different sizes.

Subheading H2

A bit more text to fill the line measure and notice the differences when changing letter-spacing, line-height, and word-spacing. Add some margin between paragraphs too.

Generated code

CSS Letter Spacing & Line Height Generator

What is CSS Letter Spacing & Line Height?

CSS Letter Spacing and Line Height are essential typographic properties that control the spacing between letters and the vertical spacing between lines of text, respectively. Proper use of these properties improves readability, enhances visual aesthetics, and allows designers to create balanced and professional layouts.

How CSS Letter Spacing Works?

The letter-spacing property adjusts the horizontal space between individual characters in text. Increasing the value creates more space between letters, while decreasing it brings letters closer together. This property is useful for headings, logos, or any text where precise character spacing is needed.

Basic Syntax for Letter Spacing

To increase the spacing between letters:

h1 {
  letter-spacing: 2px;
}

To reduce spacing between letters:

h2 {
  letter-spacing: -1px;
}

How CSS Line Height Works

The line-height property controls the vertical space between lines of text. A larger line height improves readability for paragraphs and body text, while a smaller line height can be used for compact designs. Line height can be specified using unitless numbers, pixels, ems, or percentages.

Basic Syntax for Line Height

Using a unitless number for line height:

p {
  line-height: 1.6;
}

Using pixels for line height:

p {
  line-height: 24px;
}

Combining Letter Spacing and Line Height

For optimal typography, letter spacing and line height are often adjusted together to create balanced and readable text blocks:

p {
  font-size: 16px;
  letter-spacing: 1px;
  line-height: 1.8;
}

Advanced Tips

Browser Support

Both letter-spacing and line-height are supported in all modern browsers including Chrome, Firefox, Edge, Safari, and Opera. They are widely used and reliable CSS properties for typography control.

Conclusion

CSS Letter Spacing and Line Height are fundamental tools for creating visually appealing and readable text. Using a CSS Letter Spacing & Line Height Generator allows designers to experiment with spacing adjustments quickly and efficiently. Proper use of these properties can greatly enhance the readability, structure, and overall design of your web content.

Last update: 13. 08. 2025.