Keep Last Characters Of Each Line
Keep Last Characters Of Each Line
Keep Last Characters Of Each Line cuts every line down to the number of characters you choose. Paste your text, enter a number and copy the result. It is free and runs in your browser.
Keep the Last Characters Tool
Keep the Last Few Characters Example
They looked up at the sky and saw a million stars. They looked up at the sky and saw a million stars.
million stars. million stars.
Bookmark: press Ctrl+D (Windows) or Cmd+D (Mac) to save this tool.
What does Keep Last Characters Of Each Line do?
This tool keeps the last characters of every line and removes the rest. You choose the number, and each line is cut to that many characters counted from its end.
Lines that are already shorter than the number are left alone, and empty lines stay empty. Spaces and punctuation count as characters, and the characters you keep are not changed.
Use it to take a file extension, a year, a suffix or an ID number from the end of each line.
Keep last characters of each line examples
Each example shows the number used. Spaces count as characters.
| Setting | Before | After |
|---|---|---|
| Keep 14 | They looked up at the sky and saw a million stars. | million stars. |
| Keep 3 | Hello world | rld |
| Keep 5 (short line) | Hi | Hi |
| Keep 4 (spaces count) | a b c d e | d e |
| Keep 1 | apple banana | e a |
| Keep 10 (empty line stays) | Hello there friend Ok | ere friend Ok |
How to keep the last characters of each line
- 1Add your text
Type or paste your lines into the box, or import a text file. - 2Enter the number
Type how many characters to keep from the end of each line. - 3Click Keep Last Characters
Every line is cut to its last characters at once. Use Undo if you change your mind. - 4Copy it
Click Copy and paste the result where you need it.
When to keep the last characters
Good for
Taking the end of each line, such as a file extension, a year, a postcode or an order number, from a long list.
Check first
Characters are counted from the end of each line, spaces included, so a number that starts in the middle of a word cuts the word. Use Undo right after if the result is not what you wanted.
Other tools
To keep the start of each line, try Keep First Characters Of Each Line. To delete the end instead, try Remove Last Characters Of Each Line.
Keep last characters of each line FAQ
What does the Keep Last Characters Of Each Line tool do?
It keeps only the last characters of every line and removes the rest. If you enter 14, each line is cut to its last 14 characters.
How do I keep the last characters of each line?
Type or paste your text, enter the number of characters to keep and click Keep Last Characters. The result replaces the text in the box. Click Copy to use it, or Undo to go back.
What if a line is shorter than the number?
It stays as it is. Only lines longer than the number are cut.
Are spaces counted as characters?
Yes. Spaces, punctuation and digits all count as characters, so million stars. with 14 keeps exactly 14 characters, including the space.
Does it work on each line separately?
Yes. Every line is cut on its own, counting from the end of that line. Empty lines stay empty.
What number can I enter?
Any whole number from 1 upwards. If you enter 0, a negative number or a decimal, the tool asks for a valid number and does not change your text.
Does it count emoji and accented letters correctly?
Yes. Each visible character counts as one, so an emoji or a letter with an accent is not cut in half.
Is this tool free and is my text private?
Yes. It is free, needs no account and runs in your browser, so your text is not uploaded to a server.
Looking for more text tools?
Browse Modify ToolsLast updated: 28 October 2026
