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
- 1Paste one item per line into the input panel
- 2Set `From` (zero-based, inclusive) - default `2`
- 3Set `To` (zero-based, exclusive) - default `6`, blank = end
- 4Optionally stride with Every-Nth (default `1` = every item)
- 5Output updates live; `To` past the end is clamped safely
Keyboard shortcuts
Drive ListShift without touching the mouse.
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.
Item1 Item2 Item3 Item4 Item5 Item6
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) |