Canonical: https://toolipedia.app/line-selector

# Line Selector

Keep or remove lines of pasted text by position (first or last N, a range, every Nth, odd or even) or by length, and strip a fixed prefix or suffix from each line.

Breadcrumbs: Toolipedia > Text tools > Text tools > Line Selector

## About Line Selector

Sometimes you need only some lines of a pasted block: the header removed, every second row, the last ten, or lines between 5 and 20. This selector keeps or removes lines by position (first or last N, a range, every Nth, odd or even, one numbered line) or by length (shorter or longer than N characters) or blank lines, then can strip a fixed prefix or suffix from every line that remains. With six lines, keeping every second line leaves lines 2, 4 and 6. Counts show how many lines went in and out.

## How to use Line Selector
1. Paste your lines.
2. Choose keep or remove and how to select the lines, then set N or M.
3. Optionally type a prefix or suffix to strip, then copy the result.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.

## Also known as
- line selector
- keep every nth line
- remove first line of text
- remove lines shorter than
- keep lines odd or even
- remove prefix from lines

## Frequently asked questions

### How do I remove only the first line?

Choose Remove, then select The first N lines and set N to 1. For the last line use The last N lines with N set to 1.

### What does every Nth line mean?

It selects lines N, 2N, 3N and so on. With N set to 3 you get lines 3, 6, 9. Use Remove to drop those lines and keep the rest.

### Does the prefix removal need an exact match?

Yes, the text must match the start or end of the line exactly, including capital letters. Lines that do not start or end with it are left as they are.

### Is Line Selector free?

Yes. Line Selector on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

## Related tools

More free tools that go well with Line Selector:
- [Add prefix and suffix to lines](https://toolipedia.app/add-prefix-suffix)
- [Remove line breaks](https://toolipedia.app/remove-line-breaks)
- [Remove duplicate lines](https://toolipedia.app/remove-duplicate-lines)
- [Markdown to plain text](https://toolipedia.app/markdown-to-text)
- [Text Pattern Tool: Extract, Keep, Remove, Highlight or Count](https://toolipedia.app/text-pattern-tool)
