Unicode & Text Authority
TEXT REFERENCE / TOOLS

Add line numbers

Add sequential numbers to lines of plain text.

How it works

Choose a starting integer from 0 to 999,999, an increment from 1 to 1,000, a minimum digit width from 0 to 12, a separator and whether to skip empty lines. The default increment is 1 and padding is off. Empty lines remain in the result when skipped and do not consume a number; whitespace-only lines are not empty. Line endings are normalized to LF. A trailing line break is preserved as an unnumbered terminator. Empty input produces empty output.

Copy line numbering summary

Use Copy line numbering summary to copy the displayed output code-point count as tab-separated Metric and Value columns, without copying the numbered text. With default settings, apple and pear on separate lines become 1: apple and 2: pear (16 output code points including the line break).

Numbering rules

With start 1 and a colon separator, two lines become 1: First line and 2: Second line. Empty lines can be preserved without numbering. A final line break remains a final line break. The tool adds prefixes rather than changing the original line contents. For example, start at 5, increment by 5 and use width 3 to produce 005: First line, 010: Second line and 015: Third line. Minimum digit width adds leading zeros only when needed; longer numbers are never truncated. Skipped empty lines do not advance the sequence by default.

Keep gaps for skipped empty lines

Enable Skip empty lines and Count skipped empty lines in numbering to preserve original line positions. For example, Apple, an empty line and Orange become 1: Apple, an empty line and 3: Orange. Each skipped empty line advances the configured increment without receiving a prefix. Whitespace-only lines still receive numbers; the artificial empty element after a final line break is never numbered or counted. The new option has no effect unless Skip empty lines is enabled.

Use a custom line numbering separator

Choose Custom separator and enter literal text between each number and its line. For example, with a separator of — , the first line becomes 1 — First line. Spaces and tabs are retained, and an empty separator places the number directly before the line. Use at most 1,000 UTF-16 units, without carriage returns or line feeds. Colon + space remains the default.

Source limit: 50,000 UTF-16 units; result limit: 100,000 units. Related: Alphabetical line sorter · Remove line breaks · Add prefix and suffix to lines.

Other tools

Text utilities

Encoding and conversion

Typography

Character and case tools