➕ Text Tool

Add Prefix to Lines

Add a prefix to every line of text instantly — prepend symbols, words, or auto-incrementing line numbers. Perfect for quoting text, commenting out code, and formatting lists. Free, and works entirely in your browser.

Quick presets
0Total lines
0Lines prefixed
0Output chars
0Output words

How to add a prefix to every line of text

Adding the same prefix to every line of a list, a code block, or a document by hand is slow and error-prone once you're past a handful of lines. This free line prefix tool does it instantly for text of any length — paste in your list, choose a prefix, and every line updates live as you type. It runs entirely in your browser, so nothing is uploaded to a server and there's no realistic limit on how much text you can process.

  1. Paste your list, code, or paragraph into the text box above — one entry per line.
  2. Type the prefix you want in the Prefix field, or click one of the quick presets below it.
  3. Turn on Skip empty lines if you want blank lines left untouched.
  4. Copy the result, or download it directly as a .txt file.

Add auto-incrementing line numbers

Type {n} anywhere inside the Prefix field and it will be replaced with a running line number instead of static text. For example, a prefix of {n}. turns a plain list into a numbered one (1. , 2. , 3. …), and Row {n}: is handy for labelling data rows. Use the Start numbering at field to begin counting from any number, not just 1.

💬 Quote text

Prefix every line with > to turn plain text into a Markdown or email-style blockquote.

💻 Comment out code

Use // , # or -- to comment out an entire block of code in one click instead of line by line.

🔢 Numbered lists

Use {n}. to convert a plain list into a numbered list, or Step {n}: for instructions.

📋 Format data rows

Add consistent labels like [LOG] or ID-{n}: before importing text into a spreadsheet or log parser.

More text tools on ToolsBox

If you're cleaning up or reformatting text, a few other free tools on this site pair well with this one: use the Find & Replace tool to swap out repeated phrases before or after adding your prefix, the Case Converter to fix inconsistent capitalization, or the Text Reverser if you need to flip line order. Once you've finished formatting, run the result through the Word Counter or Character Counter to check length against any limits you're working with.

Frequently asked questions

Paste your text into the input box, type the prefix you want in the Prefix field, and every line updates instantly with that prefix added to the front. You can prepend anything — symbols, words, or numbers.
Yes. Type {n} anywhere in the Prefix field and it will be replaced with an auto-incrementing line number, starting from the number you set in the Start numbering at field. For example, "{n}. " produces 1. , 2. , 3. and so on.
Paste your code into the input box and set the Prefix field to your language's comment symbol, such as // for JavaScript, # for Python, or -- for SQL. Every line is prefixed with the comment symbol instantly.
Yes, if you enable Skip empty lines, blank lines in your text are left untouched instead of receiving the prefix, which keeps paragraph spacing and formatting intact.
No. The tool runs entirely in your browser, so there is no server upload and no practical size limit — it works instantly even on documents with thousands of lines.
Yes, click Download .txt to save the prefixed text as a plain text file directly to your device.
🔗 Related tools