Yantrasagaram

Add Line Numbers

Referencing specific lines in code reviews, legal documents, or meeting notes is much easier when every line has a number. This free tool adds sequential line numbers to every line of your text instantly. Choose your starting number, pick a separator style like a period, colon, tab, or space, and enable alignment to right-justify numbers for a clean, professional look. The output updates in real time as you type or paste. Once numbered, use the Sort Lines tool to reorder them, or count the total with the Word Counter. Everything processes in your browser, so your text stays private and is never sent to any server. Paste your content, configure the numbering style, and copy the result in one click. Great for developers sharing code snippets, teachers preparing worksheets, and anyone who needs line references.

How to Use This Tool

  1. Paste or type your text into the input box. Each line break defines a new line that will receive a number.
  2. Set the starting number (default is 1), choose your preferred separator (period, colon, tab, or space), and toggle alignment on or off.
  3. The numbered output appears instantly in the output box below, updating in real time as you make changes.
  4. Click the copy button to grab the numbered text and paste it wherever you need it.

Examples

Basic line numbering

Input

apple
banana
cherry

Output (separator: period)

1. apple
2. banana
3. cherry

Starting from line 10 with colon separator

Input

function init() {
  console.log("ready");
}

Output (start: 10, separator: colon)

10: function init() {
11:   console.log("ready");
12: }

Aligned numbers with many lines

Input (lines 1-12)

January
February
...
November
December

Output (aligned, period)

 1. January
 2. February
...
11. November
12. December

What This Tool Is Useful For

Frequently Asked Questions

Can I start numbering from a custom number?
Yes. Change the "Start Number" field to any integer. For example, set it to 50 and your lines will be numbered 50, 51, 52, and so on.
What does the alignment option do?
When enabled, alignment pads shorter numbers with leading spaces so all line numbers are right-aligned. This is especially useful when you have more than 9 or 99 lines, keeping the text neatly columned.
Is there a limit on how many lines I can number?
There is no hard limit. Since everything runs in your browser, the practical limit depends on your device. Most modern computers handle thousands of lines without issues.
Does the output update automatically?
Yes. The output updates in real time as you type, paste, or change any option. There is no need to click a process button.
Is my text sent to a server?
No. All processing runs locally in your browser using JavaScript. Your text never leaves your device, keeping it private and secure.

More Text Tools

Explore more free text utilities on Yantra Sagaram:

Related Tools