Remove Last N Lines
Paste text, choose how many lines to remove from the end, and review the result locally in your browser.
Maximum 100,000 characters and 50,000 lines. Processing stays in your browser.
Paste text to begin.
A QUICK WALKTHROUGH
How to use this tool
- Enter up to 100,000 characters and 50,000 lines of plain text.
- Enter a whole number N from 1 through 50,000.
- Remove the last N lines, then copy or download the result.
Bounded removal
N must be a whole number from 1 through 50,000 and cannot exceed the number of input lines. Removing all lines produces an empty result.
Line endings and trailing newlines
LF, CRLF, and CR separators are accepted. The first detected separator is used between retained lines. A trailing newline is represented by a final empty line and is removed when that empty line is among the last N lines.
Local plain-text processing
Input is limited to 100,000 characters and 50,000 lines. Text stays in this browser and is not uploaded.
GOOD TO KNOW
Common questions
What does N count?
N is the number of lines removed from the end, including blank lines.
What happens when N equals the line count?
All lines are removed and the result is empty.
Are line endings preserved?
The first detected line ending is used between the lines that remain.