Delete List Items

Delete list items by pattern (5 match modes), line numbers, or ranges with live preview. Regex, inverse, dedup. Free, offline, client-side, instant, secure.

Filter items from any list by search pattern (contains / exact / starts-with / ends-with / regex) OR by line numbers and ranges (the original logic had this function but the UI never exposed it - now wired up). 6 separators, live preview, inverse mode, dedup output.

How to Use Delete List Items

  1. Paste your list. Pick the input separator
  2. Pick deletion mode: By search pattern (default - 5 match sub-modes) or By line numbers (use ranges like 1-5, 10, 15-20).
  3. For pattern mode, enter the search term and pick a match mode. Tick Inverse to keep matching items instead of deleting them.
  4. For line-number mode, enter comma-separated single numbers and/or ranges. Out-of-range and reversed ranges (5-3) are silently ignored.
  5. Toggle Remove empty lines to drop blanks from the output, and Dedup to also remove duplicates.
  6. Live preview updates after 200 ms. Ctrl+Enter recalculates manually.

Frequently Asked Questions

Pattern modes – when to use which?

Contains (default): item contains the search term anywhere. "apple" matches "pineapple", "apple pie", "apple". Use for fuzzy matching.

How does Inverse mode work?

Inverts the keep/delete logic. Off: matching items are deleted. On: matching items are kept, non-matching deleted. Useful for “extract just the lines mentioning X” workflows. The stats card shows matched count regardless of inverse – so you always see how many items matched, just the keep/delete decision flips.

What’s the line-number syntax?

Comma-separated single line numbers and/or ranges. Examples: 5 (just line 5), 1-3 (lines 1, 2, 3), 1-3, 7, 10-12 (combined). Spaces are tolerated. Range start must be ≤ end (reversed ranges like 5-3 are silently ignored). Out-of-range numbers (line 100 on a 50-item list) are silently ignored too. Line numbers are 1-based – line 1 is the first item.

Can I delete multiple patterns at once?

Yes – use regex mode with alternation: apple|banana|cherry matches any of those three. Or use line-number mode if you know the positions. The original FAQ said “the tool processes one pattern at a time” – true for non-regex modes, but regex alternation gets you multi-pattern in one pass.

What’s the dedup option?

After applying the filter, remove duplicate items from the output. Order preserved (first occurrence kept). Useful when you’re cleaning a list AND want unique results. Without dedup, duplicates pass through. Note: dedup is separator-aware – duplicates of the chosen separator-bounded items, not character-by-character.

What does case-sensitive affect?

For non-regex modes: "Apple""apple" when on; equal when off (compared in lowercase). For regex mode: when off, the i flag is added to your regex. So ^apple matches both Apple and APPLE. To force case-sensitive regex regardless of the toggle, use lookahead workarounds – but easier to just turn the toggle on.

Does Remove Empty also remove whitespace-only lines?

Yes. The filter is String(item).trim() !== '' – both completely empty (zero-length) and whitespace-only items are removed. If you want to keep whitespace-only items, leave this toggle off. For finer control (separately removing only ASCII whitespace vs Unicode whitespace), use the sibling tool “Delete Empty List Items”.

What if my regex is invalid?

The tool shows a diagnostic chip with the JavaScript regex parser error (e.g. “Invalid regex: Unterminated character class”). Common issues: unbalanced brackets [abc (missing ]), unbalanced parens (?:foo, invalid escape sequences. Test patterns at regex101.com or use simpler modes (contains / starts-with / ends-with) if regex is overkill.

Is my data secure?

Yes. All filtering happens in your browser. The list never leaves your device. Download is generated in-memory and offered locally.