Skip to content
Swizztool

Add Line Numbers

Add line numbers to code, transcripts, or logs. Set starting numbers, zero padding (e.g. 01, 001), delimiters, and empty line handling.

Your text 192 chars · 7 lines

Result

How to use Add Line Numbers

  1. Paste text into the editor.
  2. Set the start number, zero padding width, and delimiter.
  3. Choose whether to skip blank lines.
  4. Copy or export the numbered text.

About Add Line Numbers

Add line numbers to code, scripts, lists, or legal text. Choose the starting number, how many digits to pad to, and the separator, and the numbered text updates as you change settings.

Related tools: Word Counter, Byte Counter & Character Counter, Case Converter — Title Case & More, Remove Extra Spaces

Formatting options

Start at sets the first number, so you can continue numbering from a previous section. Digits pads numbers with leading zeros (01, 02 or 001, 002) so numbers line up in plain text and sort correctly.

Separator controls what sits between the number and the line: a period, parenthesis, colon, vertical bar, or a tab. A tab works well when you paste the result into a spreadsheet, because numbers and text land in separate columns.

Blank lines

Skip blank lines leaves empty lines unnumbered and does not count them, so numbering stays continuous across paragraphs. Turn it off to number every line, which matches how code editors count.

Common uses

Code reviews
Number a snippet so reviewers can refer to specific lines in comments.
Scripts and transcripts
Number dialogue or transcript lines for editing and quoting.
Legal and contract text
Add line numbers to a clause list for precise references.
Spreadsheet import
Use a tab separator so line numbers become their own column.

Questions about Add Line Numbers

Can numbers include leading zeroes?
Yes. You can specify zero padding widths from 1 to 6 digits.
Can I number from a value other than 1?
Yes. Set Start at to any whole number.
How do I remove line numbers later?
Use Find and Replace in regular expression mode with the pattern ^\d+\. and an empty replacement (adjust for your separator).
Does it change my original text?
No. The numbered version appears in the result pane; your text stays as you pasted it.
Can I put the numbers in a separate spreadsheet column?
Yes. Choose the tab separator, then paste the result into a spreadsheet; numbers and text land in separate columns.

Comments

Questions, ideas, or a bug in Add Line Numbers? Let us know.