All Tools View Categories About Contact Privacy

Log Line Numbering Tool

Add sequential line numbers to any log, or strip them back off with custom start, step, and separator.

Runs entirely in your browser — your logs never leave this page.
0
total lines
0
numbered
0
last number
0
output lines

    

About Log Line Numbering Tool

Line numbers are the cheapest precision tool in log analysis. A numbered log turns “the line where it crashed” into something exact: “line 412”. That precision matters when you paste a snippet into an issue tracker, ask a teammate to look at line 73, or write a script that greps line 140. Log Line Numbering Tool adds those numbers in seconds, exactly the way you want them, and can strip them back off just as quickly, without you ever leaving the browser tab.

Numbering is not one-size-fits-all. You might want plain 1,2,3 with a colon; you might need to start at 100 to align a chunk with the rest of a larger file; you might prefer a tab separator so the numbers line up as a column when pasted into a spreadsheet; you might want to number every other line with a step of 2; or you might want zero-padded numbers so thousands of lines all align in neat, sortable columns instead of drifting as the digit count grows. Every one of those is a setting here rather than something you have to script by hand, and the output preview makes it safe to experiment until it looks right.

Blank lines are treated deliberately: they stay exactly where they are in the output, but they are never assigned a number and never advance the counting sequence. That keeps numbering sensible in logs that use blank lines as section breaks — you get a clean, meaningful sequence on the lines that matter instead of gaps caused by spacing.

The reverse operation is equally useful and shares the same settings. Paste a log that already has numbers — whether you added them here or they arrived from a terminal capture or another tool — and switch to Remove mode to strip the leading number and separator, restoring clean raw text for parsing, diffing, or re-numbering with different parameters. Removal checks your configured separator first, so a round trip through this tool with a custom separator like a pipe or a tab strips cleanly, and it falls back to recognizing common generic prefixes (colon, dot, or parenthesis followed by a space) for logs that arrived already numbered by something else. The stats report exactly what changed on every run.

Features

  • Zero set-up numbering — prefix every non-empty line instantly.
  • Custom start and step values — begin at any number and count by any interval.
  • Any separator — colon, tab, dot, pipe, space, or custom text between the number and the line.
  • Zero padding — align numbers to the width of the widest line number in the file.
  • Remove mode — strip an existing number prefix, matching your configured separator first and falling back to common generic prefixes.
  • Blank-line aware — blank lines are kept in place but never numbered and never counted.
  • Live stats — total lines, numbers added or removed, last number assigned, and output line count.
  • Copy / Download TXT / Print — take the output with you in whatever form you need.
  • 100% local — nothing leaves the browser.

How to Use

  1. Paste your log into the text box, with or without existing line numbers.
  2. Pick a mode. Add line numbers to prefix every non-empty line, or Remove to strip existing prefixes back off.
  3. Set the numbering when adding: choose the start value, the step between numbers, the separator text, and whether to zero-pad for column alignment.
  4. Run. The preview shows the full result immediately and the stats cards report what changed — total lines, how many were numbered, and the last number used.
  5. Copy, download, or print the output once it looks right, or adjust a setting and run again.

Examples

Example 1 — Issue references. A 9400-line service log is impossible to discuss until you number it and point to specific lines in the ticket: line 7312 is where the request failed, 7313 the retry, 7314 the timeout. Everyone lands on the same spot instantly instead of scrolling and counting.

Example 2 — Reordering detection. Two processes each dump a log; number both with the same starting point and the line numbers diverge where the event order interleaved, making it obvious which events overlapped in time.

Example 3 — Clean capture. A colleague pastes a terminal capture full of numbered lines like “123: ”; switch to Remove mode and those prefixes are stripped so you can re-parse the raw text cleanly.

Example 4 — Aligned columns. With zero padding on, a 1200-line file renders numbers 0001 through 1200 in perfectly aligned columns, keeping a monospaced view tidy.

Example 5 — Custom separators. Numbering with a tab separator turns the output into two clean columns for a spreadsheet, and Remove mode with that same separator strips exactly that prefix back off.

Benefits

  • Exact references for issues, code reviews, and scripts that need to point at a specific spot in a log.
  • Full control over start, step, separator, and padding, so the numbering matches how you work.
  • Round-trip capable — add numbers, then remove them again using the same separator, with no manual cleanup.
  • Alignment with zero padding, so long files stay sortable in a monospaced view.
  • Blank-line safe — spacing in the original log is preserved without polluting the numbering sequence.
  • Private — all processing stays local.

Frequently Asked Questions

Why add line numbers to logs?
Numbered lines give you a precise way to reference the exact spot in a log. Instead of “the line with the stack trace” you can say “line 412”, which is exact, search-friendly, and avoids ambiguity in issue tickets and code reviews.
What does the numbering look like?
Each non-empty line is prefixed with its number followed by the separator you choose (default “: ”). You control the starting number and the step, so you can number 1,2,3 or 100,101,102, or every second line.
What is zero padding?
Numbers are padded with leading zeros up to the width of the largest number, so line 7 becomes 007 in a long file. This keeps the number column aligned for easy scanning and makes text-based sorting behave numerically.
Can it remove numbers too?
Yes. Switch to Remove mode and any leading “number + separator” prefix is stripped from each line — handy when you get logs from a terminal capture that already carry numbers and need the raw text back for parsing or diffing.
How are blank lines handled?
Blank lines are preserved in the output but not counted, so the sequence only advances on non-empty lines. This keeps the numbering sensible when logs deliberately include blank lines between sections.
Is my log uploaded anywhere?
No. Everything is processed entirely in your browser, with no network requests or uploads.