Splice a list

Remove N consecutive items from a list starting at a zero-based index. Matches JavaScript `Array.splice(from, count)`. Default `Start at: 0, Remove N: 1` drops the first item. Change Start at to delete from the middle.

Input
Ready
Output
Live

Array.splice for lists

The op is `Array.prototype.splice(from, count)` on your lines. It removes `count` items starting at index `from` (zero-based) and leaves the rest intact. Indices before `from` are untouched; indices after the removed range shift left to fill the gap.

Default `from = 0, count = 1` drops the first item. Set `from = 2, count = 2` to drop the 3rd and 4th items (`carrot` and `date` in the sample). Set `count = 0` to leave the list unchanged (no items removed).

If `count` exceeds the number of items available after `from`, splice stops at the end of the list - no error. If `from` is past the end, nothing is removed. Unlike JavaScript's splice this tool does not accept replacement items; it is remove-only. For insertion-style edits, chain with Join or Add a prefix.

How to use splice a list

  1. 1Paste your list into the input panel
  2. 2Set `Start at` to the zero-based index where removal begins (default `0`)
  3. 3Set `Remove N` to how many consecutive items to drop (default `1`)
  4. 4Output updates live; count is clamped to the available items
  5. 5To extract a range instead of removing one, use Slice a list

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this tool actually does

JavaScript `Array.splice(from, count)` - remove N items at an index.

Zero-based index

`Start at: 0` removes from the first item; `2` removes from the third; and so on. If you think one-based, subtract one.

Remove N, not replace

This tool only deletes - it does not insert replacements. For insertion, build the replacement separately and join / merge with the rest.

Count clamped safely

If `Remove N` is more than the remaining items after `Start at`, removal stops at the end of the list - no error or placeholder.

Start past end does nothing

If `Start at` is beyond the list length, no items are removed and the input is emitted verbatim.

How it differs from Slice

Slice keeps a range and drops the rest. Splice drops a range and keeps the rest. Opposite operations; same underlying `from / count` concept.

Worked example

`Start at: 2, Remove N: 2` → removes indices 2 and 3 (`carrot`, `date`). Remaining items close the gap.

Input
apple
banana
carrot
date
elderberry
fig
grape
Output
apple
banana
elderberry
fig
grape

Settings reference

How each option shapes the output using the sample above.

Setting What it does Effect on the sample
`Start at: 0, Remove N: 1` (defaults) Drops the first item `banana, carrot, date, elderberry, fig, grape`
`Start at: 2, Remove N: 2` Drops indices 2 and 3 `apple, banana, elderberry, fig, grape` (as shown in Example)
`Start at: 0, Remove N: 3` Drops the first three items `date, elderberry, fig, grape`
`Start at: 4, Remove N: 100` (count past end) Removes from index 4 through the end `apple, banana, carrot, date`
`Start at: 10` (past end) Nothing removed Input unchanged

FAQ

Is Start at zero-based?
Yes. `0` targets the first item, `1` the second, and so on. If you think one-based, subtract one.
What happens if Remove N is larger than the list?
Removal stops at the end of the list - the tool removes as many items as are actually there from `Start at` onwards, with no error.
Can I use this to insert new items?
No - this tool is remove-only. JavaScript's native `Array.splice` supports insertion via additional arguments, but we do not expose that. For inserts, build the replacement separately and merge.
How is this different from Slice / Extract fragment?
Splice removes a range and keeps the rest. Slice and Extract a list fragment do the opposite - keep a range, drop the rest. Pick by whether the range is what you want to keep or throw away.
Can I remove multiple disjoint ranges in one pass?
Not in a single invocation. Run the tool twice (mind that indices shift after the first removal) or use Delete list items for pattern-based removal.