Number lines

Add numbers with a separator and optional zero-padding (handy for logs and diffs).

Overview

Anyone who learned programming in the 1980s knows line numbers in a completely different sense: in BASIC, every line of code required an explicit number — `10 PRINT 'HELLO'`, `20 GOTO 10`. It was not optional; it was the syntax of the language. The line number was the address of the instruction, and `GOTO 100` literally meant jump to line 100. This made refactoring a nightmare: inserting a new line between 10 and 20 required renumbering everything, which gave rise to conventions like using multiples of 10 to leave room. Modern BASIC editors even introduced a `RENUM` command that automatically renumbered the entire file. When structured languages like C and Pascal replaced BASIC as the teaching language in the 1990s, line numbers disappeared from syntax — but remained indispensable as tool metadata.

Today line numbers are ubiquitous as a reference system. The `grep -n` output format includes the line number for each match — the difference between found it in the file and found it at line 347 of the file. Error messages from compilers and interpreters like GCC, Python, and rustc always include line and column: `TypeError: unsupported operand type(s) for +: 'int' and 'str' (line 23)`. The unified diff format from `git diff` uses headers like `@@ -15,7 +15,9 @@` to indicate which lines changed — and pull request reviewers on GitHub and GitLab click on line numbers to add inline comments. Editors like VS Code and Vim have commands like `:23` that jump the cursor directly to a specific line.

This tool solves the inverse problem: you have a block of text without numbering and need to add numbers to create a referenceable document. Practical use cases: turning a list of terms or items into numbered format for technical documentation; preparing pseudocode or a presentation script with step numbers; adding line prefixes to log output to create cross-references; creating exercises or exams with numbered questions from a draft. The separator and padding width are configurable — `001.`, `1:`, `1 -` — depending on the context where the output will be used.

Technical deep dive

Common questions summarized

  • What is this tool for?: It runs fully in your browser: useful to validate, format, or convert data in everyday development.
  • Are my inputs sent to a server?: Processing happens locally with JavaScript. We do not store what you paste into the text areas.
  • Can I use this for real production data?: Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.

Sample payload to try

  • See also the larger "Code Snippets" sample; paste this excerpt to try locally: Sample — a b → 001: a 002: b (com início 1 e largura 3)

Tool guide

  • What you are working with Multi-line text.

  • What the tool does Prefixes each line with a sequential number, configurable separator, and optional zero padding (001, 002, …).

  • Why use it Reference snippets in review, align with error messages that cite line numbers, format pasted logs.

Code Snippets

Code example
a
b → 001: a
002: b (com início 1 e largura 3)

Sample

a
b → 001: a
002: b (com início 1 e largura 3)

FAQ

What is this tool for?

It runs fully in your browser: useful to validate, format, or convert data in everyday development.

Are my inputs sent to a server?

Processing happens locally with JavaScript. We do not store what you paste into the text areas.

Can I use this for real production data?

Use at your own risk. For secrets (passwords, tokens), prefer controlled environments and your company policies. And always review the generated contents. Never trust blindly things you see on the internet.