Add Line Numbers

Prefix every line with a sequential number and a separator you control.

What Add Line Numbers helps you do

Prefix every line with a sequential number and a separator you control. This is the fast way to number a list, a code excerpt or meeting notes without a word processor. The numbers are plain text, so they will not renumber themselves if the list changes later.

Numbering runs in your browser. No text is sent to Haivix.

How it works

Line tools split the pasted text into lines, apply one operation to the list, and rejoin it with a newline. A blank line is still a line, so it participates in sorting, numbering and shuffling unless you remove it first. The transformation runs in the browser and keeps the existing line order except where the tool's purpose is to change it. Nothing is uploaded, and the output replaces the preview rather than the source. If the input ends with a newline, the final empty line can affect a count or a shuffle; trim the input first when that matters.

How to use Add Line Numbers

  1. Paste the text you want numbered.
  2. Choose the starting number and separator, such as a period or bracket.
  3. Add the numbers and check the first and last entries.
  4. Copy the numbered result.

When to use it

  • Number a list of steps or items for a document.
  • Add line numbers to a code sample before sharing it.
  • Create numbered test cases or checklist rows.
  • Number a list of references for a review.
  • Add stable labels to rows before a discussion.
  • Number lines for a support ticket or bug report.

When not to use it

  • Do not use it when the numbers must update automatically after edits.
  • Do not number code that will be pasted back into an editor.
  • Do not use it on a list where blank lines should stay unnumbered.

Example

Three lines with numbering starting at one and a period separator become 1. first line, 2. second line and 3. third line. A blank line between them also receives a number, so remove blank lines first if the numbering should count only content lines. The numbers do not update if a line is inserted later.

What you can do with Add Line Numbers

  • Number every line from any starting value.
  • Choose the separator, such as a period, bracket or dash.
  • Number blank lines as well as text lines.
  • Keep the original line content after the number.
  • Copy the numbered result.
  • Run the numbering locally with no upload.

Example: check the line structure first

Paste a small sample and note how many lines it has, including blank lines and a possible trailing newline. The count explains most surprises after sorting, numbering or filtering.

Apply the operation and compare the first and last lines with the source. If the structure is right, run the full text; if not, remove the blank lines or trim the input first.

Copy or download the result and keep the original until the destination accepts it. Line tools are one-way, so the source is the only undo.

For a list pasted from a spreadsheet, check for hidden carriage returns or wrapping quotes before transforming it. A stray quote can sort differently or survive a filter that looks correct at a glance.

When the result feeds another tool, run a second pass only after confirming the first. Chaining a sort and a deduplication is safe, but chaining two numbering steps produces duplicated prefixes.

If the output is going into a version-controlled file, check the diff before committing. A blank-line or line-ending change can look like a content change in review even when the words are unchanged.

What to know before you start

  • Numbering is plain text and does not update if you later insert or remove a line.
  • Empty lines are still numbered, which may or may not be what you want.
  • The start value is applied as a simple increment, with no Roman or lettered styles.
  • There is no option to skip blank lines.

Common mistakes

  • Leaving blank lines in and getting gaps in the visible numbering.
  • Expecting the numbers to renumber after editing.
  • Pasting the numbered text back into code.
  • Choosing a separator that already appears in the content.

Troubleshooting

If the numbering starts at the wrong value, check the start field.

If blank lines are numbered, remove empty lines first.

If the numbers look inconsistent, the source may have had a trailing newline that counts as a line.

If a separator is missing, check for an escaped sequence in the field.

Related standards and documentation

  • A newline is a single line separator in Unix text; Windows files may use CRLF.
  • Modern JavaScript sorts are stable, so equal lines keep their relative order.
  • Blank lines are entries, not separators, in these transformations.
  • A trailing newline is a text convention, not content; remove it before counting lines.
Blank lines are still lines
  • Count the lines before you transform.
  • Remove blanks first when they should not participate.
  • Keep the original until the result is accepted.
  • Check the last line for a trailing newline.

Frequently Asked Questions