π Add Prefix and Suffix to Every Line β Free Online
Paste a list and instantly add the same text to the beginning or end of every line. Great for formatting, commenting code or preparing data.
What this tool does
Prefix Lines adds the same fixed text to the beginning of every line and, optionally, a second fixed text to the end of every line. It turns a plain list into a bullet list, a block of comments, a set of quoted strings or any other uniformly decorated format in a single click.
Because the transformation is purely textual and local, it is safe for confidential notes, source-code fragments or customer data. Empty lines receive the prefix and suffix as well, which keeps the visual structure of the original block intact.
When to use it
- Convert a shopping list into Markdown bullets by prefixing each line with β- β.
- Comment out a block of configuration by adding β# β or β// β at the start of each line.
- Wrap every line in quotation marks for inclusion in a CSV or JSON array.
- Add a consistent label or timestamp prefix to log lines.
How it works
- Paste the lines you want to modify.
- Enter the text that should appear at the start of each line (prefix) and, if wanted, at the end (suffix).
- Press Apply. Empty lines receive the prefix and suffix as well.
- Copy the formatted result. All work happens in your browser.
Worked example
The three lines apple, banana and cherry are entered. The prefix field is set to β- β and the suffix field is left blank. After pressing Apply the output becomes β- appleβ, β- bananaβ and β- cherryβ. Changing the suffix to β.β produces β- apple.β, β- banana.β and β- cherry.β. The status line reports that the prefix and suffix were applied to three lines.
- Turn a plain list into a Markdown bullet list by prefixing each line with "- ".
- Add "// " to the start of every line to comment out a block of code.
- Wrap each line in quotes by using a prefix of '"' and a suffix of '"'.
Accuracy and limitations
- The prefix and suffix are literal strings; there is no automatic numbering or variable substitution.
- Very long prefixes combined with very long input can produce large result strings.
- The tool does not trim existing whitespace; any spaces already present on a line remain.
- It operates on whole lines only and does not modify text inside a line.
Privacy and data handling
All prefixing and suffixing happens inside your browser. The original text and the result stay on your device.
Frequently asked questions
What if I leave the prefix blank?
Lines will only receive the suffix. You can use either field independently.
Does it affect the last line if it has no trailing newline?
Yes. Every line, including the final one, receives the prefix and suffix.
Can I use it for numbering?
This tool adds a fixed string. For automatic numbering use a different utility or combine it with other text tools.
What if my list already has bullets?
The new prefix is simply added in front of whatever is already there. You can first clean the lines with another tool if needed.
Related tools
More Text tools βWord Counter
Count words and characters with reading time and keyword highlights.
Remove Duplicate Lines
Remove duplicate lines and keep only unique entries.
Case Converter
Switch text between common case styles in one click β free and private.
Extract Emails & URLs
Pull every email address and URL out of a block of text in one click.