Add Line Numbers

Add a running line number to each line of plain text. You can start from any value, place the number before or after the line, and add your own prefix or suffix around it.

Input Text
Count Start:
Prefix
Suffix
Output Text

What It Does

Add a running line number to each line of plain text. You can start from any value, place the number before or after the line, and add your own prefix or suffix around it.

How It Works

Add Line Numbers inserts new content into each relevant lines. Position matters here. Adding something before a line, after a line, or around a value can change how the output is read downstream, even when the original content stays intact.

Insertion tools are literal. If spacing around the added content matters, include that spacing in the prefix, suffix, or inserted text itself rather than assuming the tool will add it for you.

All processing happens in your browser, so your input stays on your device during the transformation.

Common Use Cases

  • Preparing pasted code for review comments in chat, docs, or tickets
  • Adding stable references to interview transcripts, notes, or log excerpts
  • Turning raw line-based text into numbered instructions or checklist material
  • Appending record numbers to exported data where the original text must stay untouched
  • Marking poem lines, script dialogue, or quotations for discussion

How to Use

  1. Paste the text exactly as you want it split into lines
  2. Choose whether the number goes before the line or after it
  3. Set the starting number and optional prefix or suffix
  4. Copy the numbered result into your document, issue, or message

Features

  • Numbers every line in order, including blank ones
  • Supports custom start values such as 0, 10, or 101
  • Lets you format the marker with your own prefix and suffix
  • Can place the number at the start or end of each line

Edge Cases

  • Very large inputs can still stress the browser, especially when the tool is working across many lines. Split huge jobs into smaller batches if the page becomes sluggish.
  • Empty or whitespace-only input is technically valid but may produce unchanged output, which can look like a failure at first glance.
  • If the output looks wrong, compare the exact input and option values first, because Add Line Numbers should be repeatable with the same settings.

Troubleshooting

  • Unexpected output often means the input is being split or interpreted at the wrong unit. For Add Line Numbers, that unit is usually lines.
  • If a previous run looked different, check for hidden whitespace, changed separators, or a setting that was toggled accidentally.
  • If nothing changes, confirm that the input actually contains the pattern or structure this tool operates on.
  • If the page feels slow, reduce the input size and test a smaller sample first.

What this tool actually changes

This page is not adding a visual gutter like an editor. It rewrites the text itself by attaching a number to every line. That distinction matters. Once you copy the result into a ticket, email, Markdown file, or support chat, the numbers travel with the text instead of disappearing with the editor chrome.

The tool counts line breaks, not sentences or list items. If your input has twelve lines, the output will have twelve numbered lines. Blank lines are still lines, so they receive a number too. That is usually the right behavior when you need references that match the exact shape of the source material.

Why the before-or-after setting matters

Putting the number before the line is the familiar option for code snippets, transcripts, and instructions. Appending the number after the line is less common, but it is useful when the original start of each line must remain untouched. That comes up when lines begin with timestamps, bullet markers, prompts, or fixed-width identifiers that people do not want to shift.

The prefix and suffix fields let you decide what the marker looks like. You might use [ and ] to produce [12], or a suffix like : to produce 12:. Because the tool treats the prefix and suffix as literal text, it stays predictable.

Where it helps in practice

Code review in a shared doc: paste a short function, add numbers at the start, and teammates can say "line 7" without relying on screenshots.

Interview transcript cleanup: keep each spoken line in place, start at 1, and create references for quotes you need to verify later.

Log excerpts in a bug report: start at 101 so the snippet lines line up with the source log segment you are discussing.

Workshop handout: add a suffix such as ) so each prompt line reads like 3) Explain the output.

Poetry or legal text: preserve deliberate blank lines instead of collapsing them, so references still match the original layout.

Examples

Example 1: standard numbering before each line

Input
alpha
beta
gamma

Settings
Suffix: . 

Output
1. alpha
2. beta
3. gamma

Example 2: start from 10 with a suffix

Input
Install dependencies
Run tests
Deploy

Settings
Start: 10
Suffix: ) 

Output
10) Install dependencies
11) Run tests
12) Deploy

Example 3: append numbers after each line

Input
00:03 User joined
00:08 Error raised

Settings
Before Line: off
Prefix:  [
Suffix: ]

Output
00:03 User joined [1]
00:08 Error raised [2]

Example 4: blank lines are counted

Input
Title

Body

Settings
Suffix: : 

Output
1: Title
2: 
3: Body
4: 

Common mistakes

If the result looks odd, the issue is usually spacing in the prefix or suffix. For example, a suffix of ) produces 1)Line, while a suffix of ) produces 1) Line. The tool will not insert an extra space unless you include one.

Another common misunderstanding is expecting automatic indentation or aligned columns for double-digit numbers. This tool numbers lines in sequence, but it does not pad values to equal width. If you need strict visual alignment, add the numbering first and then run the output through a separate spacing or column-formatting step.

When not to use it

If you only need temporary line references while editing code, your editor's built-in line gutter is a better fit. Use this tool when the numbers need to become part of the copied text itself.

Frequently Asked Questions

Does this tool store or save my text?

No, all processing happens entirely in your browser. Your text is never uploaded to any server, stored, or logged. This ensures complete privacy and security for sensitive content.

Can I start numbering from something other than 1?

Yes. The Count Start field controls the first number. If you enter 25, the lines will be numbered 25, 26, 27, and so on.

What happens to empty lines?

They are counted and numbered like any other line. That preserves the original layout, which is often important for scripts, poems, transcripts, and pasted log blocks.

What do prefix and suffix do?

They wrap the generated number with your own text. For example, prefix `[` and suffix `] ` produce markers like `[7] `, while a suffix of `: ` produces `7: `.

Can I put the number after each line instead of before it?

Yes. Turn off the Before Line option and the tool will append the formatted number to the end of each line.

Does the tool align single-digit and double-digit numbers automatically?

No. It writes the numbers as plain text in sequence. If you need padded values such as 01, 02, 03, you would need a separate formatting step.