We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better
Accurately count the number of lines in any text. Ideal for code auditing, document editing, and log analysis.
Enter text to view statistics
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
Paste or type plain text to see total characters, characters excluding whitespace, whitespace-separated word segments, UTF-8 bytes, total lines, and nonempty lines. The counter evaluates the text in the input box; it does not open a Word document, PDF, spreadsheet, or log file and does not classify code, comments, sentences, or records.
Total lines preserve empty lines. Nonempty lines count lines that still contain something after whitespace at the beginning and end is ignored. Comparing them helps reveal blank or whitespace-only lines.
The character value follows the browser string length convention: UTF-16 code units. A symbol such as many emoji can occupy two code units. “Words” are chunks separated by one or more whitespace characters, not dictionary-based word segmentation.
The byte result is the size of the pasted string after UTF-8 encoding. It is not necessarily the size of a saved file in another encoding and does not include document formatting or file metadata.
Carriage-return plus line-feed (CRLF), a lone carriage return (CR), and a lone line-feed (LF) each divide lines. For any nonempty input, the total is the number of recognized line breaks plus one. That means a final Enter creates an empty last line: alpha
beta
has three total lines and two nonempty lines. An entirely empty input shows no statistics.
Whitespace-only lines remain in the total but are not nonempty. A long line that wraps visually in the input box is still one text line unless it contains an actual line-break character.
Use total lines when physical line structure matters, such as checking a copied list or reviewing a code excerpt. Use nonempty lines to estimate populated entries when each entry occupies one line. The difference between those two readings is the number of empty or whitespace-only lines under this counter’s rule.
The character total includes spaces and line breaks. The whitespace-excluded total removes tabs, line breaks, and other whitespace matched by the counter’s rule, not just ordinary spaces. UTF-8 bytes can exceed the character value for many non-ASCII characters.
Enter Hi, then a line break, then 🙂. The input has two lines and two nonempty lines. Its UTF-16 string length is four code units: “H” and “i” (one each), the line break (one), and the emoji (two). The whitespace-excluded character value is three, and the UTF-8 byte value is seven: two ASCII bytes, one LF byte, and four bytes for the emoji. If you add a blank line at the end, total lines increase while nonempty lines do not.
For a code review, compare physical and nonempty lines, then inspect the excerpt for comment-only or syntax-only lines yourself. For a one-item-per-line list, use the nonempty count as a quick cross-check and scan for duplicates separately. For a publishing limit, confirm whether the destination counts bytes, code points, grapheme clusters, or words; these displayed measurements may use a different convention.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Copy the exact plain-text excerpt you want to measure. Formatting, hidden spreadsheet cells, PDF page layout, and comments are not inspected as document structure.
Use the text area or its example control. Counts update as the text changes; the input length limit is 100,000 characters.
Compare total lines with nonempty lines for blank-line checks. Read characters, words, or bytes only when their counting convention matches your destination.
Copy the individual displayed result for a note or checklist. Clear the field before measuring a separate sample.
Use cases
See how the tool fits into real work and everyday tasks.
When each entry should occupy one line, compare nonempty lines with the expected item count. This flags blanks but does not identify duplicate entries or multi-line records.
Before sharing a snippet or log segment, check its physical size and nonempty lines. The figures do not distinguish executable code from comments or infer how many application events a line represents.
Use the character and byte readings as a preliminary check when preparing text for a form or publishing field. Verify the receiving service’s own counting rule before trimming content.
Q&A
Find concise answers to common questions and confusing cases.
Yes. A nonempty string ending in a recognized line break has an empty final line, so its total line count is one greater than the number of line breaks.
Not in general. The counter splits at text line breaks and does not parse CSV quoting; a valid field can contain a line break inside a quoted record.
The character reading uses UTF-16 code units. Some visible symbols, including many emoji, use a pair of code units. A user-perceived character count can therefore differ.
Notes
Review scope, result limitations, and important precautions before use.
These are measurements of the text as pasted, not a semantic analysis or a count of the original file’s records, code statements, or visual wrapped rows.
Related
Discover related tools, collections, and available API capabilities.