Line Prefix & Suffix
BetaAdd a prefix, a suffix, or line numbers to every line of a text. Start at any number, step by any amount, pad with zeros, and skip blank lines. Runs in your browser, no signup.
- Free, no sign-up
- REST + MCP
- Updated
- Reviewed by Olgun Ozoktas
Options
Lines: 0
Lines changed: 0 / 0
How to add line numbers, a prefix, or a suffix
-
Paste the lines
Paste the text into the Input box, one item per line, or click Load sample. The result appears in the output box at once. -
Set the prefix and suffix
Type the text to add at the start of each line in Prefix and the text to add at the end in Suffix. Leave either empty to add nothing there. -
Choose the numbering
Keep Number the lines on for a numbered list. Set Start at, Step, and the Number format, and turn on Pad with zeros for aligned numbers. -
Copy the result
Click Copy to put the result on your clipboard, then paste it into your document, code, or spreadsheet.
Common use cases
Markdown lists
SQL and JSON values
Scripts and transcripts
Bulk file names and paths
Why use a line prefix and suffix tool?
The Line Prefix & Suffix tool applies the same small edit to every line of a text: a prefix at the start, a suffix at the end, and an optional line number ahead of both. Numbering starts at any whole number, steps by any amount, follows a format you type with {n} as the placeholder, and pads with zeros on request. Blank lines can be skipped so a paragraph break neither changes nor consumes a number.
The function is the same one behind the REST tool line-prefix-suffix and the MCP tool line_prefix_suffix, so a script or an AI client produces exactly what the page shows. The page adds a counter for the lines changed and a sample to try.
Pair it with the Text Line Sorter to order the lines first, the Duplicate Line Remover to drop repeats, and Find & Replace to edit text inside the lines.
How it compares
A text editor with multi-cursor support can add a prefix to every line, and a spreadsheet can do it with a concatenation formula, but numbering with a custom format, zero padding, and blank-line handling takes a macro or a script in both. A dedicated tool makes those five options explicit fields and shows the result as you type.
Compared with other online line tools, this one does one job and states it: it never sorts, dedupes, or edits the middle of a line. It runs in your browser rather than on a server and offers the same function through a REST endpoint and an MCP server for automation.
Tips
- Sort or dedupe the lines first with the Text Line Sorter or the Duplicate Line Remover, so the numbering stays clean.
- Use "{n}\t" as the number format to separate numbers from text with a tab. Spreadsheets split that into two columns on paste.
- Turn Pad with zeros on for file names. 01 to 12 sorts correctly in every file manager; 1 to 12 does not.
- Leave Skip blank lines on for prose. Paragraph breaks keep their place and do not consume a number.
- Watch the Lines changed counter. It tells you how many lines received the prefix, suffix, or number.