Compress a List
Compress any list by removing duplicates, blank lines, trimming whitespace, stripping numbering, and sorting. Instant results with compression stats.
About
Lists degrade. Copy-paste cycles introduce duplicate entries, inconsistent numbering, trailing whitespace, and phantom blank lines. A 200-line vendor list may contain 40 duplicates you cannot spot by eye. This tool applies deterministic compression: exact-match deduplication via hash set, regex-based numbering removal, and whitespace normalization. The output preserves original casing and order (unless sorting is enabled). Compression ratio R = 1 β LoutLin is reported as a percentage. Note: deduplication is case-sensitive by default. Enable case-insensitive mode if your list mixes capitalization for identical entries.
Formulas
The compression ratio quantifies how much the list was reduced:
Where Lin = number of input lines, Lout = number of output lines. Deduplication uses a hash-set approach with O(n) time complexity. Each line is optionally normalized (lowercased, trimmed) before insertion into the set. The numbering strip regex pattern is: match(/^[\s]*(\d+[.)\-:]?\s*|[-*β’Β·βΊβΈβΉ]\s*)/). This captures ordered markers (1., 2), 3-) and unordered bullets (-, *, β’).
Reference Data
| Operation | Description | Effect on Line Count | Preserves Order |
|---|---|---|---|
| Remove Duplicates | Eliminates exact-match repeated lines | Reduces by duplicate count | Yes (keeps first occurrence) |
| Case-Insensitive Dedup | Treats "Apple" and "apple" as identical | Reduces further | Yes (keeps first occurrence) |
| Remove Empty Lines | Strips lines containing only whitespace | Reduces by blank count | Yes |
| Trim Whitespace | Removes leading/trailing spaces per line | No change | Yes |
| Strip Numbering | Removes leading numbers, dots, dashes, bullets | No change | Yes |
| Strip Prefix | Removes user-defined prefix from each line | No change | Yes |
| Strip Suffix | Removes user-defined suffix from each line | No change | Yes |
| Sort AβZ | Alphabetical ascending sort | No change | No (reordered) |
| Sort ZβA | Alphabetical descending sort | No change | No (reordered) |
| Reverse Order | Flips the entire list upside down | No change | No (reversed) |
| Collapse Blank Lines | Replaces consecutive blanks with one | Slight reduction | Yes |
| Remove Short Lines | Removes lines below character threshold | Reduces | Yes |