Count lines | Count Your Lines Quickly
Use our Count Lines tool to find the total number of lines in any text. Paste your content for instant results.
Quick Tips
- Drag and drop a .txt, .csv, .log, .md or code file directly onto the input area to load it instantly.
- Press Ctrl + Enter (Cmd + Enter on Mac) to re-run the analysis.
- Use the transformation buttons (sort, dedupe, remove empty) to clean a list before counting.
- The Line endings field tells you whether the file uses Unix LF, Windows CRLF or classic Mac CR - useful when debugging cross-platform files.
- Reading time uses an average of 225 words per minute - a research-backed pace for adult silent reading.
Real-time analysis
Sixteen metrics - total lines, empty, non-empty, duplicates, words, sentences, paragraphs, reading time and more - recompute as you type.
Deep text statistics
Average / longest / shortest line, longest word, unique-word count and Unix vs. Windows line-ending detection.
One-click transformations
Remove duplicates, sort, reverse, trim whitespace, strip empty lines or add line numbers - applied directly to the input.
Drag-and-drop file load
Drop any .txt/.csv/.log/.md/.json/.xml/.html/.css/.js/.py/.sql file (up to 5 MB) directly into the editor.
Half-million-character capacity
Handles up to 500,000 characters in the browser - enough for full chapters of a book, large logs or 10,000-line CSVs.
Fully private
All processing happens in your browser. Nothing is uploaded, logged or persisted.
Code analysis
Count SLOC (lines of code), spot empty/duplicate lines and review average line length before a refactor.
Writing & editing
Hit a word count, estimate reading time and check sentence pacing for an article, blog post or essay.
Data cleaning
Drop a CSV, dedupe lines, sort alphabetically and re-export - perfect for cleaning email lists or address dumps.
Email / SMS templates
Verify your message stays inside character limits with the Characters and Characters (no spaces) counters.
Log inspection
Quickly tell how many lines a log file contains, how many are blank, and whether the line endings match your platform.
SEO and content audits
Word count, paragraph count and reading time - the three metrics every content audit checklist asks for.
Free JSON API and Model Context Protocol (MCP) server. No signup, no API key, CORS open. Designed for Claude, ChatGPT, Cursor, scripts and frontend apps.
curl -X POST https://mate.tools/api/v1/count-lines.php \
-H "Content-Type: application/json" \
-d '{"text":"line one\nline two\n\nline four"}' import urllib.request, json
req = urllib.request.Request(
"https://mate.tools/api/v1/count-lines.php",
data=json.dumps({"text": "line one\nline two\n\nline four"}).encode(),
headers={"Content-Type": "application/json"},
)
with urllib.request.urlopen(req) as r:
print(json.load(r)["metrics"]) const r = await fetch("https://mate.tools/api/v1/count-lines.php", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text: "line one\nline two\n\nline four" }),
});
console.log((await r.json()).metrics); Add to claude_desktop_config.json (Claude Desktop), ~/.cursor/mcp.json (Cursor), or any other MCP-compatible client:
{
"mcpServers": {
"mate-tools": {
"command": "npx",
"args": ["-y", "@mate-tools/mcp-server"]
}
}
} npm: @mate-tools/mcp-server · Full install guide: /api/mcp · Source: view server.js
Frequently Asked Questions
How Do I Count Lines of Text?
wc -l).