Zero-based slice with optional stride
The op is `Array.slice(from, to)` on your non-empty lines. `From` includes the item at that index; `To` excludes it. Defaults are `From = 2, To = 6` - with a 7-item sample that gives you indices 2, 3, 4, 5 (Item3 through Item6).
Leave `To` blank to slice to the end of the list. Negative indices count from the end: `From = -3` is "third-from-last", `To = -1` excludes the last item.
Every-Nth applies after the slice as an index filter - `2` keeps every other item from the sliced range, `3` keeps every third. Default `1` keeps all items. Out-of-bound ranges return empty output with no error.
How to use extract a sublist by range
- 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 set Every-Nth stride (default `1` = every item)
- 5Output updates live; out-of-bound or invalid ranges return empty
Keyboard shortcuts
Drive ListShift without touching the mouse.
What this tool actually does
Array.slice semantics with an Every-Nth post-filter.
Zero-based, From inclusive, To exclusive
`From = 2, To = 6` gives four items at indices 2, 3, 4, 5. Matches JavaScript `Array.slice` and Python `list[from:to]`. If you think 1-based, subtract one everywhere.
Negative indices count from the end
`From = -3, To = blank` returns the last three items. `To = -1` excludes the last item. Use negative indices for tail-relative slices without knowing the list length.
Blank To means end
An empty `To` field (or unset) slices from `From` through the last item. Useful for "everything from index N onwards" without knowing the count.
Every-Nth applies after slicing
The slice runs first, then the stride filter keeps every Nth item of the slice output. The stride is relative to the slice, not the original list.
Same op as sibling slice tools
Extract a list fragment, Slice a list, and this page all use the same underlying `slice_range` op with the same defaults. Three URLs, one tool.
Worked example
Defaults `From = 2, To = 6, step = 1`. Slice returns indices 2..5 → Item3, Item4, Item5, Item6.
Item1 Item2 Item3 Item4 Item5 Item6 Item7
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: 0, To: 3` | First three items | `Item1`, `Item2`, `Item3` |
| `From: -2, To: blank` | Last two items | `Item6`, `Item7` |
| `From: 0, To: blank, Every-Nth: 2` | Every other item from the whole list | `Item1`, `Item3`, `Item5`, `Item7` |
| `From: 5, To: 2` (From > To) | Invalid range - empty output | (empty) |