Zero Signup ToolsFree browser tools

Text Tools

Prefix and Suffix Lines

Add a prefix or suffix to every line. Wrap each line in quotes, add a trailing comma, build SQL IN lists, or number lines. Runs locally in your browser.

Quick presets

0 chars

Output

Output updates instantly. Everything runs in your browser. Lines are never uploaded.

Total lines

0

Lines wrapped

0

Blank lines

0

Lines dropped

0

Prefix and suffix

Blank lines
Trim each line

Placeholders

{n} is replaced with the current line number. Numbering skips lines that are dropped or passed through, so the counter only advances on lines that are actually wrapped.

{line} is replaced with the original line text. Useful when you want the value to appear inside both the prefix and the suffix, for example [{line}](#{line}) for a self-anchored Markdown link.

The prefix and suffix fields also accept \t (tab), \n (newline), \r (carriage return), and \\ (literal backslash). Use \{ if you need a literal opening brace inside a prefix.

Whitespace handling runs before the prefix and suffix are applied, so "Trim whitespace before wrapping" will strip indentation from your source lines but keep any whitespace you wrote inside the prefix or suffix.

How to use

  1. Paste your text into the input. Each line is treated as one item.
  2. Pick a preset, or type your own prefix and suffix. Use {n} for the current line number and {line} for the original line text.
  3. Choose what to do with blank lines: wrap them with the prefix and suffix, leave them untouched, or drop them.
  4. Turn on Trim whitespace before wrapping if you need to clean leading or trailing spaces from each line first.
  5. Use the Copy output button to grab the result, or Download .txt to save it as a file.

About this tool

Prefix and Suffix Lines rewrites every line in a block of text with a prefix in front and a suffix at the end, in a single paste. Type whatever you want at the start of each line (a bullet, a quote, a tab indent, a SQL or shell comment marker, a Markdown list marker) and whatever you want at the end (a comma, a semicolon, a closing tag, a Markdown trailing-space hard break), and the output updates as you type. A curated preset row covers the searches that bring most people here: wrap each line in single quotes with a trailing comma for a SQL IN clause, wrap each line in double quotes with a trailing comma for a JSON string array, add a comma or semicolon at the end of every line, turn lines into Markdown bullets or numbered list items, wrap lines in HTML <li></li>, prepend a code comment marker (# for shell or Python, // for JavaScript or C), prepend a > for a Markdown blockquote, indent every line with a tab, and number each line with a configurable start and step. Two placeholders make per-line templates possible: {n} expands to the current line number (the counter only advances on lines that are actually wrapped, so dropping blank lines never produces gaps in the numbering), and {line} expands to the original line text, which is useful when the line value has to appear inside both the prefix and the suffix, for example building a Markdown link of the form [{line}](#{line}). Escape sequences \t, \n, \r, and \\ are decoded in the prefix and suffix fields so a tab indent or a multi-line wrap can be typed without leaving the keyboard. Blank lines can be wrapped along with the rest, passed through untouched, or dropped from the output entirely; trim mode strips leading and trailing whitespace from each line before the prefix and suffix are applied, which is the right choice when the goal is to clean a copy-pasted column from a spreadsheet. Useful for turning a list copied out of a spreadsheet into a SQL IN list, building a JSON string array from a vertical list, prefixing comment markers to a block of code, indenting code into a method body, formatting Markdown lists or blockquotes, building HTML lists from a paste, prepending a project tag or ticket prefix to every line, and quickly numbering rows for a checklist. Everything runs locally in your browser; the text you paste here is not uploaded, logged, or shared.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsText Tools