Remove line numbers from text, free and private
To remove line numbers from text for free, paste the numbered text into the Input Text box or click Choose File. The tool detects how the lines are numbered, strips the numbers and shows the clean text under Cleaned Text, with the indentation of code left alone. Copy it or click Download .txt. It all happens in your browser, so the Network tab in DevTools shows nothing being uploaded.
A line number is a counter at the start of a line, such as 12:, 12., 12) or 12 |, that you do not want when you reuse the text. The tool handles colon, period, bracket, pipe, tab, comma and space styles, and it names the one it found in a status line so you can check it.
To go the other way and number lines, use add line numbers. If the pasted text also has gaps, follow up with remove empty lines.
Table of Use: numbering styles and results
Each row shows what you paste and what comes out. ↵ marks a line break, ␣ a space and ⇥ a tab.
| Where the numbers come from | Input | Setting | Result |
|---|---|---|---|
| Code copied with a numbered gutter | 1:␣def greet(name):↵2:␣␣␣␣␣return name | Auto-Detect (finds a colon) | def greet(name):↵␣␣␣␣return name |
| A numbered list | 1. Buy milk↵2. Call Sam | Auto-Detect (finds a period) | Buy milk↵Call Sam |
| Numbers in brackets | (1) alpha↵(2) beta | Auto-Detect, or Bracket (1)) | alpha↵beta |
| A pipe-separated listing | 9 | alpha↵10 | beta | Auto-Detect (finds a pipe) | alpha↵beta |
| Output of cat -n or nl | ␣␣␣␣␣1⇥alpha↵␣␣␣␣␣2⇥beta | Auto-Detect (finds a tab) | alpha↵beta |
| Lines with a label | Line 1: alpha↵Line 2: beta | "Also remove a word before the number" ticked | alpha↵beta |
| Timestamps, which are not line numbers | 08:15 Breakfast↵09:30 Meeting | Auto-Detect | Unchanged, with "No line numbering detected" |
Features
- Auto-Detect or choose. Auto-Detect samples the first 100 non-blank lines. Or pick Colon, Period, Bracket, Pipe, Tab, Comma or Space under "What follows the number?".
- Careful with real content. Decimals such as 1.5, amounts such as 1,000, codes such as Q1 and sentences such as "Windows 10 fixed it" are never taken for line numbers. Auto-Detect also passes over a list of times such as 08:15 or a plain column of numbers, but a separator you choose is applied as chosen, and once Colon is in use a line that starts with a time loses its hour.
- Keep indentation. On by default. The number and its padding go, the code's own indentation stays, whether the numbers are one digit or several. If the padding can be read two ways, the status box asks which layout the numbers use.
- Labels removed too. Words such as "Line" or "Step" before the number can be removed in any script, with the option ticked by default.
- Status line. Shows the separator it found and how many lines were changed, for example 3 of 4 lines.
- Other lines left alone. A wrapped line without a number is kept as written. A line that holds only a number and its separator becomes an empty line.
- Line endings kept. Unix, Windows and old Mac line breaks stay as they were, including a final line break.
- Files and Use Result. Open .txt, .md, .json, .xml, .csv, .log, .html, .css, .sql and common code files such as .py, .js, .ts, .java, .go and .sh; Download .txt saves unnumbered-text.txt. Use Result feeds the output back in for a second pass.
Once the numbers are gone, put a snippet through the JSON formatter or SQL formatter, or compare it with another copy in the text diff tool.
How to Remove Line Numbers Step by Step
- Paste the numbered text into Input Text, or click Choose File under "Or open a text file".
- Read the status line under the options. It says what was detected and how many lines were cleaned.
- If it found nothing or the wrong style, choose a separator under "What follows the number?".
- Leave "Keep indentation" ticked for code. Untick "Also remove a word before the number" if your lines start with a word that you want to keep.
- Check Cleaned Text, then click Copy or Download .txt. Use Result runs a second pass; Reset clears everything.
Who Can Use It
Developers and students paste code from a tutorial, a PDF or a web page that shows a line-number gutter, and need it to run. System administrators strip numbers from cat -n and nl output before saving a script or config.
Writers, paralegals and editors clean numbered transcripts, drafts and checklists, then sort the lines with sort lines alphabetically, drop repeats with remove duplicate lines or measure the text with the word counter and line counter. For a leftover pattern this tool does not cover, try find and replace with a regular expression.
FAQs
How do I remove line numbers from text for free?
Paste the numbered text into the Input Text box, or click Choose File to open a text or code file. The tool finds the numbering style by itself and shows the text without numbers under Cleaned Text. A status line names the separator it found and how many lines were changed. Click Copy or Download .txt to keep the result.
How do I remove line numbers from copied code without breaking the indentation?
Leave Keep indentation ticked, which is the default. Only the number and the padding after it are removed, so each line keeps its own leading spaces or tabs and Python or YAML code stays valid. When numbers of different widths leave it unclear how much of the space is padding, the status box names the lines affected and lets you choose the layout. If you untick it, every line is pushed flush left, which is fine for prose but will break code that depends on indentation.
How does auto-detect work, and when should I pick the separator myself?
Auto-Detect reads the first 100 non-blank lines and looks for a separator that follows a number on more than half of them, with the numbers going up. If it finds nothing or picks the wrong one, use "What follows the number?" and choose Colon, Period, Bracket, Pipe, Tab, Comma or Space. Then every line that starts with a number and that separator is changed.
Why does it say "No line numbering detected"?
Usually because fewer than half the lines start with a number, the numbers do not rise, the numbers stand alone with no text after them, or two numbering styles are mixed. A list of years or a column of prices is treated as data. Pick the separator manually. The tool removes one style per pass, so for mixed styles run it again with Use Result.
Will it remove numbers that belong to my text, like dates, decimals or list items?
Only a number at the very start of a line, followed by the separator, is removed, and numbers inside a line stay. Decimals such as 1.5, amounts such as 1,000, codes such as Q1 and sentences like "Windows 10 fixed it" are never stripped. A list of times such as 08:15 is not detected as numbering, but once Colon is in use, a line that starts with a time loses its hour. A genuine numbered list, "1. Buy milk", is stripped.
Can I remove line numbers from cat -n or nl output?
Yes. The usual output of cat -n and nl is a number, a tab and the text, whether the number is right-aligned or left-aligned. Auto-Detect reads that as Tab and removes the padding spaces around the number as well. A blank line that nl writes with an empty number column becomes an empty line, and the text after the tab is kept as it was.
How do I remove labels like "Line 1:" or "Step 2." from each line?
Keep "Also remove a word before the number" ticked, which is the default. A word followed by a number and a colon, period, bracket, pipe or comma, such as "Line 1:" or "Step 2.", is removed along with the number. Untick it if you only want to clean lines that begin with the number itself. Codes such as "Q1:" are never treated as labels.
Is my text uploaded when I remove line numbers?
No. The numbers are removed by JavaScript in your browser, and a file you open is read on your device, so nothing is sent to ZipConvert or anyone else. Open the Network tab in DevTools while you paste and you will see no request. Nothing is saved, so closing or refreshing the tab clears the text.