How to use the Add Line Numbers
Add line numbers to any text in four steps:
1
Paste your text
Paste any multi-line text, code snippet, or list into the input area.
2
Configure numbering
Set the starting number (default: 1), choose a separator style (pipe, tab, dot, colon, space, or custom), and toggle zero-padding if needed.
3
Set line options
Toggle 'Skip empty lines' to leave blank lines unnumbered, preserving your document's visual spacing.
4
Copy or download
Click 'Add Line Numbers' then copy the output or download as a .txt file.
When to use this tool
Use to add line numbers for reference, sharing, and review:
- →Adding line numbers to code snippets before pasting into emails, tickets, or documentation where IDEs are unavailable
- →Numbering lines in log files so team members can reference 'line 347' precisely in bug reports
- →Adding line numbers to a poem, script, or legal document for easy annotation and discussion
- →Creating a numbered list from a plain list for use in ordered reference documents
- →Preparing text for code review where reviewers need to cite specific line numbers in comments
- →Numbering exam questions or a list of steps before printing or distributing
Frequently asked questions
Q:Can I start numbering from a number other than 1?
Yes — set any integer as the starting number. This is useful when you are numbering a continuation of a previous block: if your first block ends at line 45, set the starting number to 46 for the next block so line references remain consistent across both sections.
Q:What does zero-padding do and when should I use it?
Zero-padding left-pads all line numbers with zeros so they have the same width: 01, 02, 03 … 10 instead of 1, 2, 3 … 10. This ensures columns align perfectly in monospace fonts and in file systems that sort alphabetically. Enable it for log files, shell scripts, or any output where visual alignment and lexicographic sort order matter.
Q:What separator styles are available?
Six separator styles are available: Tab (a tab character between the number and the line content), Pipe ( | ), Dot (. ), Colon (: ), Space (a single space), and Custom (any string you type). Pipe is the most visually distinctive for sharing in Markdown or plain text documents. Tab is best for pasting into spreadsheets where it will be split into columns automatically.
Q:What does 'Skip empty lines' do?
When enabled, blank lines are passed through to the output without a line number prefix, preserving the visual spacing of your document while keeping the numbering continuous across non-empty lines. When disabled (the default), every line including blank ones receives a number.
Q:Can I add line numbers to code and then remove them later?
The tool adds line numbers as a prefix but does not provide a built-in 'remove line numbers' function. To remove the numbers later, paste the numbered output back into a text editor and use a regex find-and-replace: for pipe separator, find `^\d+ \| ` and replace with nothing. For tab separator, find `^\d+\t` and replace with nothing.
Q:Is there a limit on how many lines can be numbered?
There is no enforced limit. The tool processes all lines in the input in a single synchronous pass in your browser, so it handles files with tens of thousands of lines without issue. Very large files may take a fraction of a second to render in the output panel, but the numbering itself is instantaneous.