Text File Statistics
Drop in a text file to count its words, lines, characters, and bytes, like the Unix wc command but in your browser. It also reports blank versus non-empty lines, the line-ending style (LF, CRLF, CR, or mixed), the longest line and its line number, the average line length, and whether the file uses a byte-order mark. The file is read entirely on your device and never uploaded.
How to count words and lines in a text file
- Drag a .txt, .log, .md, or .csv file onto the box, or click to browse for one.
- Read the stat cards: bytes, characters, words, lines, blank lines, and more.
- Check the line-ending and longest-line details to spot formatting issues.
Examples
A server log file
access.log dropped onto the tool
2.4 MB, 18,902 lines, 0 blank lines, line ending LF, longest line 412 chars
Frequently asked questions
Is my file uploaded anywhere?
No. The file is read and analyzed entirely in your browser using JavaScript. Nothing is sent to a server, so logs, drafts, and other sensitive text stay on your device.
How does this work without an upload?
Your browser reads the picked file into memory, decodes it as UTF-8, and counts everything locally. There is no network request, which is also why it works offline once the page has loaded.
How are characters counted versus bytes?
Characters are Unicode code points, so an accented letter or an emoji counts as one character. Bytes are the raw file size, which is larger for multibyte text such as UTF-8 accents or emoji.
What counts as a line, and what about the last line?
A line is the text between line breaks. If the file ends with a newline, that trailing empty segment is not counted as an extra line, so a file ending in a newline reports the number of separators, not one more.
How does it detect line endings?
It scans for Windows (CRLF), Unix (LF), and classic Mac (CR) breaks. If only one style appears it is named directly; if more than one appears the result is mixed, which often signals an editing or merge issue.
What is a BOM and why does it matter?
A byte-order mark is an invisible marker (the bytes EF BB BF) some editors add to the start of UTF-8 files. The tool detects and reports it, and excludes it from the character count so the first line stays clean.
Related tools
File Type Identifier
Find out what a file really is from its magic bytes, not its extension. Detects images, audio, video, archives, fonts, and more in your browser. Private.
CSV File Inspector
Inspect a CSV file in your browser: detect the delimiter, encoding and BOM, count rows and columns, guess the header, and preview sample rows. Private.
Hex Viewer
View any file as a classic hex dump in your browser: byte offsets, two-digit hex, and an ASCII gutter side by side. Nothing is uploaded. Copy the dump.
Base64 File Encoder
Encode any file to Base64 and a data URI in your browser. Drop a file to get the raw Base64 and a ready data: URI to copy. Nothing is uploaded.
CBOR Decoder
Decode a CBOR file (RFC 8949) to readable JSON in your browser. Handles integers, byte strings, arrays, maps, tags, and floats. Nothing is uploaded.
ELF Header Inspector
Drop a Linux or Unix binary to read its ELF header: 32 or 64-bit, endianness, file type, CPU architecture, OS ABI and entry point. Runs in your browser.