How to Remove Line Numbers From Copied Text Without Losing the Words
To remove line numbers from copied text, first check that the numbers are actually in the pasted text. If each line starts with a number and a dot or closing parenthesis, use the Text Cleaner’s Find & Replace with Use regular expression on, this in Find, and an empty Replace with field:
^[ \t]*[0-9]+[.)][ \t]+
This removes prefixes such as 1. and 12) at the start of lines. It leaves 12 inside a sentence alone. Choose a different pattern if the numbers are followed by a colon or tab. Always compare the result with the original: a genuine numbered list can look exactly like an unwanted line-number gutter.
First, are the numbers part of the text?
Copy two or three lines into a plain-text field. If the numbers appear there and your cursor can select them, they are literal characters. You can remove those prefixes from the copied text. If they are only shown in the margin of a Word document, remove the display setting in Word instead. Microsoft’s instructions are Layout → Line Numbers → None for the document or selected section. That changes Word’s line numbering; it will not erase digits already pasted into another app.
Look at the separator too. A dot, ), colon or tab after each number gives you a safer target than a number followed by a space. If the text has no consistent separator, there may be no reliable bulk replacement. Work on a small selection and inspect it before cleaning the rest.
A before and after
Here is an invented excerpt from a numbered transcript. The number in the second sentence is part of what the speaker said, so it must stay.
Before
1. Mara: The first draft is ready.
2. Ravi: I counted 12 references in it.
3. Mara: Please check the last two.
After
Mara: The first draft is ready.
Ravi: I counted 12 references in it.
Mara: Please check the last two.
The pattern matches the number, punctuation and following space only at the beginning of each line. TextFixerr’s regex mode applies ^ to the start of every line, which is why it does not remove the 12 after counted.
Remove the prefixes in TextFixerr
- Keep a copy of the original. Paste a short representative sample into the Text Cleaner.
- For ordinary prose, leave General Clean selected. It also tidies extra spaces and blank lines. If you need only the line numbers changed, switch off its Whitespace options, including Trim entire text under Advanced Cleaning Options.
- Open Fine-tune your clean → Advanced Cleaning Options → Find & Replace. Tick Use regular expression.
- Paste
^[ \t]*[0-9]+[.)][ \t]+into Find. Leave Replace with empty, then press Clean Text. - Compare each changed line with the input. Check the beginning of the text, lines without a prefix, and lines that contain other numbers. When the sample looks right, repeat with the full passage.
The pattern does not have to recognize every possible numbering style. It should match the style in your text. The result stays in your browser; the pasted text is processed there, not uploaded to TextFixerr. If you change the pattern and want a second pass on the result, use Move Result to Input first. Otherwise, another clean starts from the original input.
Match the separator you actually have
Use one pattern per consistent style. In these examples [TAB] is a visible label for a real tab character, not text to type.
- For
1. Textor2) Text, find^[ \t]*[0-9]+[.)][ \t]+. This removes the leading number, dot or), and following spaces or tabs. - For
12: Text, find^[ \t]*[0-9]+:[ \t]+. The colon must have a space or tab after it, so a time such as08:15stays. - For
12[TAB]Text, find^[ \t]*[0-9]+\t. This removes the number and its tab, leaving spaces inside the remaining text alone.
The [0-9]+ part means one or more ASCII digits. The [ \t]* part accepts spaces or tabs before the number; [ \t]+ requires whitespace after the punctuation. That required separator matters: a decimal such as 1.5 is not the same shape as 1. Text.
If some lines use dots and others use colons, clean one style, inspect the result, then use Move Result to Input for the second pattern. Do not start with a broad rule that removes every leading number: a year (2026 goals), a quantity (12 people) or a list item may be real content.
When the pattern is ambiguous
Plain 1 Text numbering is hard to separate from a sentence that begins with a number. No regex can infer which is a gutter from that shape alone. If the numbers increase in sequence, you can use that as a visual check, but the Text Cleaner does not auto-detect or verify the sequence. Select only the lines you know are numbered, or remove the few prefixes by hand. Likewise, leave a numbered procedure numbered if its steps need to stay in order. For literal Markdown list markers, see the separate Markdown cleanup guide.
Code needs extra care. A tab or spaces after a line marker may be part of the code’s indentation. General Clean changes some whitespace, so do not paste whitespace-sensitive code through the default preset and assume it is unchanged. Use your code editor’s regex replace and compare the indentation line by line, or turn off every TextFixerr whitespace option before using Find & Replace. Avoid Trim each line, Tabs → spaces and line-joining modes for code. The guide to extra spaces and tabs explains what those switches do.
Finally, line numbers are different from page numbers printed once per PDF page. The latter may appear in the middle of a copied paragraph and need a separate decision; see fixing text copied from a PDF. If a transcript also has hard line breaks, remove unwanted numbering first. Then decide whether the lines should be joined, keeping speaker turns and intentional paragraph breaks intact.
Sources
- Add or remove line numbers — Microsoft Support
- Input boundary assertion: ^, $ — MDN Web Docs
This guide was drafted with AI assistance. See the editorial policy for how guides are written and corrected.