ForHosting KIT · Text & AI

Count duplicate list items

In apple, banana, apple, cherry, banana, apple there are 6 items, 3 unique values and 3 extra copies: apple appears 3 times and banana twice. Every repeated value is listed with its count, and your list stays untouched. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
apple banana apple cherry banana apple
You get
Total items
6
Unique items
3
Duplicate item count
3
Repeating value count
2

Lists of product codes, email addresses, inventory SKUs, survey answers, and log tags often hide silent duplicates that inflate counts, break uniqueness constraints, or skew analytics. This tool counts how many list items are duplicates—extra copies beyond the first occurrence of each value—and reports every repeating value with its exact frequency so you can audit and clean data without writing a one-off script. Paste a multi-line list, optionally fold case or trim outer spaces, and receive total items, unique values, the number of extra duplicate occurrences, and a ranked table of only the values that appear two or more times.

What the duplicate count tells you

A list item is one line of the multi-line text you submit. The engine splits on newlines after normalizing carriage returns, optionally trims each line, then builds a frequency map of values. Unique items are the distinct keys in that map.

Duplicate item count is the number of extra copies: total items minus unique items. That single integer answers how many list items are duplicates in the practical sense used by data cleaning—how many rows you could drop while still keeping one representative of every value. Separately, repeating value count is how many distinct values appear at least twice, and the duplicates array lists only those values with their full count and the number of extras (count minus one).

Rows sort by count descending, then by the display value ascending, so ties never flip between runs. Whitespace-only lines are still items when trim is false; when trim is true (the default), a line of only spaces collapses to the empty string and can participate in the map like any other value. This page is not a word-frequency counter over free prose, not a CSV row deduper, and not a remove-duplicate-lines rewrite tool—those solve different search intents.

Here the product promise is audit first: count extras, name the offenders, and leave the original list untouched so you decide what to delete.

Where a duplicate-item counter earns its keep in data work

Data analysts paste column exports to measure how many SKUs or customer IDs are repeated before a warehouse load, turning a vague suspicion of dirty data into an exact extra-copy count and a ranked list of the worst offenders. Support and operations teams audit ticket tags, assignee lists, and inventory serials so dashboards stop double-counting without forcing an immediate destructive dedupe. Teachers and coding courses use the tool as a deterministic oracle for list-processing exercises that ask students to report frequencies of repeated values rather than only drop them.

Content and marketing teams check survey free-text options and form multi-select dumps for accidental double entries that would skew pie charts. Failed validation does not consume balance. Use it as the measurement step before you call a dedupe tool, merge CSVs, or accept a user upload—count first, clean second, and keep both steps reproducible.

Audit inventory and ID lists before import

Paste SKUs, serials, or customer IDs and see how many extra copies exist plus which values repeat most often before you load a warehouse or CRM.

Classroom and coding answer keys

Generate reproducible duplicate counts and frequency tables for list-processing homework without trusting opaque spreadsheet formulas.

How do I count duplicate list items?

Send a non-empty multi-line text field where each line is one item.

Does this remove duplicates from my list?

No. This tool only measures and reports. Use a dedicated remove-duplicate-lines or CSV dedupe capability when you want a cleaned list; count first if you need an audit trail.

What is the difference between duplicates and repeating values?

Duplicates are the extra copies you could delete while keeping one of each value, 3 in the example. Repeating values are the distinct entries that appear at least twice, here apple and banana, so 2.

Do Apple and apple count as the same item?

Only if you turn on the option to ignore case. Then both merge into one value, reported with the spelling that appeared first. By default the comparison is exact, so they stay separate.

Do spaces at the start or end of a line matter?

Not by default: outer spaces are trimmed, so apple and the same word with a space before it count as one value. Turn trimming off when spaces are meaningful, as in fixed-width codes.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/str/count-duplicate-items

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/str/count-duplicate-items \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"apple\nbanana\napple\ncherry\nbanana\napple"}'
{
  "text": "apple\nbanana\napple\ncherry\nbanana\napple"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "str.count_duplicate_items",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Use it free in the browser while exploring a messy export, or call the API at $0.002 per successful request when pipelines need a reproducible duplicate audit before import or merge.

What counting duplicate list items means and what the response contains

The first-seen spelling of each key is kept as the reported value even when ignore_case is true, which preserves the casing you typed first while still merging Apple with apple. The response also echoes the ignore_case and trim flags and tags operation as count_duplicate_items for multi-tool pipelines. Empty input is always invalid_input: a blank form must not become a silent success with zero duplicates.

Input contract, flags, limits, and error behaviour

Optional trim defaults to true so accidental leading or trailing spaces do not invent phantom uniqueness; set trim false when spaces are meaningful (for example, fixed-width codes). Keep goldens pinned to the rounded contract: integer counts and a stable sort so CI never flinches on ordering. POST a JSON body with required field text: a non-empty string whose lines are the list items. Aliases input, value, data, s, message, string, content, body, and list are accepted so spreadsheets, query forms, and typed widgets can reuse the same contract. Finite numbers and booleans are stringified; objects and arrays are rejected so a mistaken nested JSON body does not become an unhelpful dump. Optional ignore_case defaults to false for exact comparison; set it true when you want case-insensitive keys for human-entered labels. Length is capped at sixty-five thousand five hundred thirty-six characters so a runaway paste cannot monopolize a Worker; longer payloads fail with an explicit limit message rather than a truncated silent cut. On success you receive total_items, unique_items, duplicate_item_count, repeating_value_count, has_duplicates, the duplicates array of value, count, and extra, plus the echoed flags and operation. On failure the task raises invalid_input with a clear message naming the problem—missing text, empty string, over-length payload, or a non-boolean flag—and validation failures are not billed. Pair the free browser run on this page with the priced API when you need the identical duplicate report inside an automated pipeline without shipping your own frequency scanners.

Where a duplicate-item counter earns its keep in data work

Unlike remove-duplicate-lines tools, this endpoint never rewrites the source list; it only measures, which is what auditors and change-control processes need before anyone deletes rows. The browser path is free for exploration; successful API calls cost $0.002 with no model tokens and no outbound network.

CI fixtures and seed scripts

Assert that a multi-line fixture has zero duplicate_item_count, or pin expected counts for intentional repeats, before a seed or merge job runs.

What does duplicate_item_count mean?

It is total_items minus unique_items: how many list positions are extra copies. For apple, banana, apple you get total 3, unique 2, and duplicate_item_count 1.

How do ignore_case and trim work?

ignore_case (default false) merges values that differ only by letter case, keeping the first original casing. trim (default true) strips leading and trailing spaces on each line before comparison.

What does counting duplicate list items cost?

The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.

Read the full KIT documentation →