Free CSS Tool

Truncate Textto Any Number of Lines

Generate -webkit-line-clamp CSS instantly. Adjust line count, font size, and line height — then copy production-ready CSS, Tailwind, or React code.

👁️

Live Preview

See your text clamped in real time as you adjust the controls. No guesswork.

📋

Three Output Formats

Copy ready-to-use CSS, Tailwind utility classes, or React inline styles — whatever your stack needs.

100% Client-Side

Everything runs in your browser. No sign-up, no server, no uploads. Instant and private.

Controls

3
110
16px
10px32px
1.6
1.02.5
600px
200px800px

Live Preview

— clamped to 3 lines

The quick brown fox jumps over the lazy dog. Sphinx of black quartz, judge my vow. Pack my box with five dozen liquor jugs. How valiantly did Blazing Haze quench jets of foe vim!

— without clamping —

The quick brown fox jumps over the lazy dog. Sphinx of black quartz, judge my vow. Pack my box with five dozen liquor jugs. How valiantly did Blazing Haze quench jets of foe vim!
Max height: 77px (3 × 1.6 × 16px)
.line-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
3
Lines
77px
Max height
100%
Browser support

Frequently Asked Questions

Everything you need to know about CSS Line Clamp Generator.