Paste your text and set the max number of lines, and the tool renders a live truncated preview with the matching -webkit-line-clamp CSS.
Combined with display:-webkit-box and box-orient:vertical, it limits text to a number of lines and adds an ellipsis.
The -webkit-line-clamp approach works across all modern browsers, including Chrome, Safari and Firefox.
Yes, set the line count to 1, though single-line truncation can also use text-overflow:ellipsis.