piapia123
en

Add Prefix or Suffix to Lines

Text

Everything runs locally in your browser — nothing is uploaded

Input
Drop a file here to load its contents
Output

Add the same prefix, suffix, or both to every line — handy for indenting, adding quote markers (`> `), or turning a list into CSV fragments. Prefixes and suffixes support escapes such as `\t` and `\n`: a literal backslash plus letter becomes a tab or a newline, because a text box cannot produce a tab character — without this you could never add indentation. You can also add line numbers (`1. ` style) with an adjustable start and zero-padding. Blank lines are skipped by default, so a paragraph full of blank lines is not stuffed with the prefix, and blank lines do not consume a number. Everything runs in your browser; nothing is uploaded and nothing goes over the network.

Features

  • Add the same prefix, suffix, or both to every line
  • Prefixes and suffixes support \t \n \r \\ escapes for tabs and line breaks
  • Add line numbers too, with adjustable start and zero-padding
  • Blank lines are skipped by default; a switch turns it back on
  • Blank lines are not numbered and do not consume a number
  • Line numbers use the 1. style (number, dot, space)
  • Copy any single line or the whole result
  • Everything runs locally in your browser; nothing is uploaded

How to use

  1. Paste the lines you want to process
  2. Set a prefix / suffix (write \t for a tab, \n for a newline)
  3. Tick line numbers if you want them, and set the start and zero-padding
  4. The result updates as you type; click Copy to take it

FAQ

How do I indent every line with a tab?
Write `\t` (backslash plus t) in the prefix. A text box cannot produce a tab character, so the tool turns the literal `\t` into a real tab; likewise `\n` becomes a newline, `\r` a carriage return, and `\\` a single backslash.
Why are blank lines skipped by default?
Text copied from documents usually contains blank lines. Applying the prefix to those too stuffs them with the marker, leaving a row of odd characters on screen, and with line numbers it wastes a number. So they are skipped by default; turn on “Apply to blank lines too” if you want them included.
What does the zero-padding do?
A value of 3 pads the number to `001`, `002`, `010`; 0 means no padding. A number already longer than the width is left as-is, never truncated. Negative numbers are not padded (that would give `00-1`).

Related tools