Duplicate Item Counter
Count how many times each line or list item appears.
Written by Anil Gautam · Updated
How are total, counted and unique lines calculated?
Total lines is every line in the box, blank ones included, and a final line break after the last item adds one more. Counted lines is what remains after blank lines are skipped. Unique items is the number of distinct values; each is listed once with its count, in the order it first appears. Duplicates is the number of distinct values that occur more than once. For the number of extra copies, subtract Unique items from Counted lines.
Paste Red, blue, Red, Green, red, Blue with a trailing space, an empty line and Red, one per line. With the default settings the output reads Total lines = 8, Counted lines = 7 and Unique items = 5, followed by Red = 3, blue = 1, Green = 1, red = 1 and Blue = 1. The Duplicates card shows 1, since only Red repeats.
The copied output keeps that layout: the three totals, a blank line, then one item = count row per value. To move the counts into a spreadsheet, paste the rows and use the split text to columns feature with = as the separator, checking any item that contains an equals sign of its own.
How do the trim, blank line and case options change the counts?
Turn off Case sensitive and the same list gives Red = 4, blue = 2 and Green = 1: three unique items, two of them duplicated, and 7 minus 3 = 4 extra copies. Each group keeps the first spelling found, which is why blue stays lowercase although Blue also appears.
The Trim spaces option strips spaces from both ends of each line before comparing, so Blue with a trailing space counts the same as Blue; turn it off when leading spaces are part of the data. Ignore blank lines skips empty and space-only lines. With it off, blank lines are counted as an item with an empty label, shown as a row with nothing before the equals sign. Sort by count lists the most frequent items first and breaks ties alphabetically.
When should you use a different list tool?
Each line is one item, so a comma-separated row counts as a single value; put each value on its own line first. For word frequency inside running text, Keyword Density Analyzer counts individual words and phrases. Remove Duplicate Lines deletes repeats and keeps one copy of each line in its original order, and Compare Lists shows which values one list has that the other lacks. Counting runs in your browser.