UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeText & ContentLine Numbering

Related Tools

Word CounterCase ConverterParagraph FormatterKeyword DensityText ReverserLorem IpsumEnglish Lorem IpsumBangla Lorem IpsumHindi Lorem IpsumArabic Lorem IpsumSpanish Lorem IpsumFrench Lorem IpsumGerman Lorem IpsumDutch Lorem IpsumPortuguese Lorem IpsumItalian Lorem IpsumRussian Lorem IpsumChinese Lorem IpsumJapanese Lorem IpsumKorean Lorem IpsumTurkish Lorem IpsumPersian Lorem IpsumSwahili Lorem IpsumUkrainian Lorem IpsumPolish Lorem IpsumIndonesian Lorem IpsumText ↔ BinaryText ↔ HexText ↔ Base64Morse CodeWhitespace RemoverLine CounterText DiffFind & ReplaceSlug ConverterText CleanerText SorterURL EncodeNumber to WordsRoman NumeralsDuplicate RemoverPalindromeNATO AlphabetText CipherReading LevelEmoji RemoverWord FrequencyChar Limit CheckerCapitalization ToolText RepeaterText WrapperSentence CounterText ShufflerSyllable CounterText SeparatorText StatisticsASCII Art GeneratorSentence SplitterAvro Bangla TypingColumn Formatter

Line Numbering & Prefix/Suffix Tool

Add line numbers to any text with custom start, step, prefix, suffix and padding. Skip blank lines, strip existing numbers, copy in one click.

You Might Also Like

All Text & Content

Word Counter

Count words, characters, sentences, paragraphs, lines and reading time as you type, with live keyword density analysis. Free and private.

Case Converter

Convert text between UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, and kebab-case.

Paragraph Formatter

Clean and reformat text by removing extra spaces, collapsing blank lines, trimming each line, or joining into a single line.

Keyword Density

Measure how often each word appears in your content, as a raw count and a percentage of total words, with the top 20 terms ranked as bars.

Code review tools, diff viewers, and most text editors show line numbers in a fixed gutter — but paste that text into a chat, a document, or a ticket and the numbers vanish. Line Numbering Tool adds them back as part of the content, so a colleague reading the pasted block can refer to line 14 and know exactly which one you mean.

Beyond the basic case, four independent controls let you reshape the numbering to match whatever format the receiving end expects. A log processor may want zero-padded four-digit counters. A LaTeX listing increments by 5 so reviewers cite line 10, 15, 20. A Markdown snippet needs nothing after the number at all. Combining start value, step, prefix and suffix covers all of these without any manual editing.

Worked Example: Numbering a Code Snippet

Click Load Sample to paste a six-line JavaScript function. With Start at set to 1, Step to 1, no prefix, a two-space suffix, and Space padding active, the output reads:

  • 1 function greet(name) { on the first line and 6 greet("Aria"); on the last — each number right-aligned to the same width as the highest line number.
  • Switch Number which lines? to Skip blank and the blank line between the closing brace and the call keeps its position but receives no number. The counter jumps from 4 to 5, skipping the gap. The stats bar then shows 1 under Blank skipped.
  • Tick Strip existing leading numbers, paste the already-numbered output back in, and hit the button again. The old numbers are removed before fresh ones are applied. Without this toggle the second pass would produce 1 1 function greet….

What Each Option Changes in the Prefix and Suffix Fields

  • Before number is prepended verbatim. Enter [ and set After number to ] to produce [1] line one, [2] line two.
  • After number defaults to a tab character. A tab aligns the content columns in monospace environments regardless of how many digits the line number uses.
  • Step increments by any positive integer. Set it to 10 to produce BASIC-style numbering: 10, 20, 30. Set it to 5 for LaTeX linenos style. The padding width is always computed from the largest number that will appear, so a 500-line file starting at 100 with a step of 10 pads to four digits from the first line.
  • Zero padding left-pads with 0 instead of spaces. Useful when the numbered output will be sorted alphabetically and numeric sort is unavailable.

Size and Performance: The 5 000-Line Ceiling

  • Inputs longer than 5,000 lines are rejected with the message Input has N lines — the limit is 5,000. All numbering runs synchronously in the render cycle, and beyond that size the pause becomes noticeable on mid-range hardware.
  • A non-integer or blank Start at field shows Start number must be a valid integer. Negative integers and zero are accepted. Counting backwards from −1 or starting a diff at line 0 are both valid uses.
  • A Step below 1 shows Step must be a whole number of at least 1. A step of 0 would produce the same number on every line, which is never useful and would make the padding-width calculation divide by zero.
  • All processing is local — the text never leaves the browser tab.

Number padding

Number which lines?

Paste text above, or hit Load Sample to try a code snippet.