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.

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}", "").

Try:
0Words
0Characters
0No spaces
0Sentences
0Paragraphs
0Lines
0Pages
0Reading
0Speaking

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

  1. Paste your text into the box.
  2. Type how many characters to cut.
  3. Press "Remove from start" or "Remove from end".
  4. Check the result and press Undo if the count was off — then adjust and try again.

Related tools

Wrap textBreaks long lines at a set column, always at a word boundary.Filter linesDeletes — or keeps — every line that matches a word or pattern.Add line numbersNumbers every line, in the format you choose — and removes numbering too.Split into chunksBreaks long text into equal parts by characters, words or lines.Group generatorPaste names, choose how many groups, get evenly sized random teams.Small capsSmall capital letters that paste anywhere plain text goes.Title case vs sentence caseThree style guides, three different answers, and the four-letter rule that…

See all text tools →

Frequently asked questions

What happens to lines shorter than the number I set?

They become empty lines rather than producing an error. Use the remove empty lines tool afterwards if you want them gone.

Does it count emoji and accented letters correctly?

Yes. Characters are counted as they are displayed, so removing one character removes one visible character rather than half of a multi-byte sequence.

How do I remove a prefix that is not always the same length?

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.

Can I truncate every line to a maximum length?

Yes, use "Keep only first N". Note that it cuts at the exact character, including mid-word.

Does it affect blank lines?

Blank lines have nothing to cut, so they stay blank.