Slice a list

Paste one item per line and slice out items between `From` (inclusive) and `To` (exclusive) using zero-based indices. Optional Every-Nth stride applies after the slice. Same op as Extract a list fragment and Extract a sublist by range.

Input
Ready
Output
Live

Zero-based slice, same as Array.slice

Internally this is `Array.prototype.slice(from, to)` on your non-empty lines. `From` includes the item at that index; `To` excludes it. The default `2..6` on a 6-item sample returns indices 2, 3, 4, 5 (Item3..Item6).

Blank `To` means "slice to the end of the list". Negative values count from the end - `From = -3` is "third-from-last", `To = -1` excludes the last item.

Out-of-bounds `To` (beyond the list length) is clamped to the end - no error, just the available items. `From > To` returns an empty slice. Every-Nth filters the slice output by index afterwards.

How to use slice a list

  1. 1Paste one item per line into the input panel
  2. 2Set `From` (zero-based, inclusive) - default `2`
  3. 3Set `To` (zero-based, exclusive) - default `6`, blank = end
  4. 4Optionally stride with Every-Nth (default `1` = every item)
  5. 5Output updates live; `To` past the end is clamped safely

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.slice` semantics, with post-slice Every-Nth filter.

Zero-based, From inclusive, To exclusive

Matches JavaScript `Array.slice` / Python `list[from:to]` exactly. `From = 2, To = 6` gives four items at indices 2, 3, 4, 5.

Out-of-bounds To is safe

If `To` is past the list length, the slice is clamped to what is actually available. No error, no exception - just the items up to the end.

Negative indices from the end

`From = -3` starts three items before the end. `To = -1` excludes the last item. Handy when you want tail slices without computing length first.

Every-Nth for data sampling

Stride `2` keeps every other item of the slice, `3` every third. Applied after the slice, so indices are relative to the slice output, not the input list.

Same op as siblings

Shares the `slice_range` op with Extract a list fragment and Extract a sublist by range. Three URLs, one engine.

Worked example

Defaults `From = 2, To = 6, step = 1`. Indices 2..5 → Item3..Item6.

Input
Item1
Item2
Item3
Item4
Item5
Item6
Output
Item3
Item4
Item5
Item6

Settings reference

How each option shapes the output using the sample above.

Setting What it does Effect on the sample
`From: 2, To: 6` (defaults) Indices 2..5 inclusive `Item3`, `Item4`, `Item5`, `Item6`
`From: 2, To: 5` Indices 2..4 inclusive `Item3`, `Item4`, `Item5`
`From: 0, To: blank` Entire list `Item1`..`Item6` (six items)
`From: 0, To: blank, Every-Nth: 2` Every other item `Item1`, `Item3`, `Item5`
`From: 0, To: 100` (past end) `To` clamped to end of list `Item1`..`Item6` (no error)

FAQ

Are the indices zero-based?
Yes. The first item is at index 0. If you think one-based, subtract one when entering From / To.
Is To inclusive or exclusive?
Exclusive. `From = 2, To = 6` returns indices 2, 3, 4, 5 - the item at index 6 is NOT included. Matches JavaScript `Array.slice` / Python `list[from:to]`.
What if To is larger than the list?
The slice is safely clamped to the end of the list. No error, no placeholder - just the items that actually exist.
Can I use negative indices?
Yes. `From = -3` starts three items from the end. `To = -1` excludes the last item. Useful when you want a tail slice without knowing the exact length.
How does this differ from the other slice-family tools?
It does not differ - same op, same defaults, same behaviour. Extract a list fragment and Extract a sublist by range are sibling URLs for different search intents.