๐Ÿ”ง TL3 Tools

Live demo (works without JavaScript):

Sample input โ€” paste anything and watch the result update.
โ†’
01. Sample input โ€” paste anything and watch the result update.

๐Ÿ”ข Add / Remove Line Numbers

Written by Alex Chen ยท Reviewed by Jane Smith ยท July 19, 2026

Prefix each line with a line number and separator, or strip existing line numbers.

Input

Output

Numbering a Three-Line List, Step by Step

Paste these three lines into the input box:

apple
banana
cherry

With the default separator of ". " and a starting value of 1, the output is:

1. apple
2. banana
3. cherry

Set Pad numbers to width to 3 and rerun. The same input returns 001., 002., and 003. prefixes, which keeps the column aligned once a list grows past nine items:

001. apple
002. banana
003. cherry

The padding comes from the browser's padStart method, which fills the left side of the number with zeroes until the requested width is reached.

What the Line Numbering Tool Does

Add / Remove Line Numbers is a browser utility with two jobs: prefix every line of pasted text with a running number, or strip an existing number prefix from each line. Anyone preparing code listings, transcripts, contracts, or step-by-step instructions reaches for the add side, and anyone cleaning up exported or copied material uses the remove side. Both operations act on lines split at the newline character, and both run inside the open tab.

How the Add Mode Builds Each Line

When you click Add Line Numbers, the page splits the input at every newline, keeps the pieces in order, and walks through them one at a time. For each piece it takes the starting value, adds the piece's position, pads the result to the requested width, then glues on the separator and the original text. The number for the piece at position i is start + i, and the output line is that number, the separator string, and the line content joined together.

Three fields control the result. Separator accepts any string: ". ", ") ", ": ", "| ", or even " -> ". Start from sets the first number, which helps when a list continues from an earlier page. Pad numbers to width adds leading zeroes, so a width of 3 turns 7 into 007.

What Remove Mode Strips

The remove button applies one regular expression to the start of every line: optional leading spaces, one or more digits, optional whitespace, then one optional separator chosen from a period, closing parenthesis, closing bracket, closing brace, colon, pipe, or hyphen, followed by any trailing spaces. A line that begins "12) orange" loses the "12) " prefix and keeps "orange"; "7: pear" becomes "pear"; "5- plum" becomes "plum".

The expression always consumes the leading digits, even without a separator, so "2026 results" comes back as "results" and "1st place" loses its leading "1". A number that sits after other characters, such as "Item 1:", is left alone, because the digits are not at the start. Separators outside the set, like the ">" in "10>", are not consumed either, so that line returns as ">" after the digits go.

Where the Tool Is Picky

The add side numbers every piece the newline split produces, including empty ones. Pasting a trailing newline therefore adds a numbered blank line at the end, so delete the trailing newline first if the output should finish at the last real line. An empty input still produces one line, which with a separator of ". " renders as "1. ".

Padding applies to the number string, so a width of 3 yields 001 through 999 and then 1000 with no further adjustment. The output textarea must hold the whole result, so inputs in the megabyte range can make the tab feel sluggish even though each line is cheap to build.

Round-Tripping: Number, Then Strip

Numbering and removing are designed to cancel each other out. Paste a line that begins with a word, add numbers, then remove them, and the text comes back byte for byte, because the remove pattern eats exactly the prefix the add mode produced. The symmetry breaks the moment a source line already starts with digits. Take the single line "2026 results": add mode turns it into "1. 2026 results", and remove mode then consumes the generated "1. " and the original leading "2026" together, returning "results". The tool cannot tell the two digit runs apart, so round-trips are only lossless when every original line starts with a non-digit character.

Line Endings and the Trailing Newline

The page splits on the newline character alone. Text copied from a Windows program usually ends each line with a carriage return followed by a newline, so the carriage return stays attached to the end of every line and survives both numbering and removal. The output therefore keeps the carriage returns the input carried.

Separator and Width Combinations

The separator and the pad width work together, and each pairing suits a different format. A code listing reads well with a pipe and a space, "| ", so "function openFile()" becomes "001| function openFile()" with a width of 3. A numbered clause in a contract pairs better with a closing parenthesis, ") ", while a recipe step takes a plain colon, ": ". The separator is not restricted to one character, so " -> " produces "007 -> call the server". Keep the width close to the digit count the list will need: a width of 2 handles lists up to 99 items, and a width of 3 handles up to 999, after which the padding stops growing. Pasting the output into a fresh tab keeps no memory of the settings, so a second list needs the same fields set again.

Line Numbering FAQ

Does the tool number blank lines inside the text?

Yes. An empty line in the middle of the input is a line like any other and receives the next number, which keeps the numbering aligned with the original row count.

Can I start numbering at a value other than 1?

Set the Start from field to any whole number. A transcript that picks up at page 12, for example, can start at 120 without renumbering anything by hand.

Why did my "10]" prefixes survive remove mode?

Remove mode only strips the separators listed above. A closing square bracket is included, but a format built on a different character, such as "10>" or "10_", keeps the digits and drops only what the expression matches.

What happens to the original text when I remove numbers?

Nothing. The source textarea keeps its content and the result lands in the output box, so the two can be compared side by side.

Is the text sent anywhere?

The numbering happens locally, so nothing leaves the tab.

Does remove mode need the exact separator I used?

No. The pattern accepts a period, closing parenthesis, bracket, brace, colon, pipe, or hyphen, whichever appears, so a mixed list such as "1. alpha", "2) beta", and "3: gamma" all clean up in a single pass.

When Numbered Output Helps

Reach for the add side when a reviewer needs to say "line 14" instead of pointing at a screen, when a checklist benefits from explicit ordering, or when a legal or academic document calls for numbered clauses. Reach for the remove side when imported material carries numbering that a spreadsheet or editor does not need. Skip the tool when the text must stay exactly as typed, because renumbering anything that is not a plain line list will mangle the structure.