Remove first or last characters
Cuts a fixed number of characters from the start or end of every line.
Set a number and press a button. Every line loses that many characters from the start or the end. Lines shorter than the number become empty rather than causing an error.
When a fixed cut is the right answer
This looks blunt, and it is — which is exactly why it works on machine-generated text where every line has the same shape.
- Timestamps in logs. Every line starts with
2026-07-22 14:03:11— that is 20 characters. Remove 20 from the start and you have the messages alone, ready to sort or deduplicate. - Fixed-width data. Old exports and mainframe reports pad every field to a set width. Cutting a known number of characters is how you take a column out.
- Stripping a prefix you added. Removed the wrong number of characters, or added a marker you now regret? Cut it back off.
- Trailing commas or semicolons. Remove one character from the end of every line.
- Quoted lines. Remove one from each end and the quotes are gone.
- Truncating for a limit. "Keep only first N" cuts every line down to a maximum length — useful for preparing short labels, though it cuts mid-word.
Counting characters correctly
Characters are counted as people see them. A line beginning with an accented letter or an emoji loses one character
when you ask for one, not half of a code point — which is what a naive substring does and why some tools
turn your text into replacement diamonds when the data is not plain English.
When to use something else
A fixed cut only works when the thing you are removing is always the same length. If the prefix varies — a log
level that is sometimes WARN and sometimes ERROR, a name before a colon — counting characters
will eat into your data on some lines and leave residue on others.
In that case use find and replace with a regular expression anchored to the start, or extract text between two markers, which finds the boundary instead of assuming its position. A good habit: cut a few characters, look at the result, undo, adjust. The undo button keeps that loop cheap.
Doing it without this tool
Excel: =MID(A1, 21, LEN(A1)) removes the first 20 characters;
=LEFT(A1, LEN(A1)-1) removes the last one.
Notepad++: column selection with Alt+drag over the first N characters, then Delete — reliable only if every
line is at least that long, otherwise the selection skews. The regex alternative is search ^.{20} and
replace with nothing.
Command line: cut -c21- file.txt keeps from the 21st character on;
sed 's/.$//' file.txt drops the last character of every line.
Google Sheets: =REGEXREPLACE(A1, "^.{20}", "").
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Paste your text into the box.
- Type how many characters to cut.
- Press "Remove from start" or "Remove from end".
- Check the result and press Undo if the count was off — then adjust and try again.
Related tools
Frequently asked questions
They become empty lines rather than producing an error. Use the remove empty lines tool afterwards if you want them gone.
Yes. Characters are counted as they are displayed, so removing one character removes one visible character rather than half of a multi-byte sequence.
A fixed cut is the wrong tool for that. Use find and replace with a regular expression anchored with ^, or extract text between two markers, so the boundary is found rather than assumed.
Yes, use "Keep only first N". Note that it cuts at the exact character, including mid-word.
Blank lines have nothing to cut, so they stay blank.