Add text to the start and end of every line

Put the same text before and after each line of a list. Nothing leaves your browser.

How it works

  1. Paste your lines
  2. Type the text to add before and after
  3. Copy the new lines

What gets added and where

The first box holds text that goes before every line and the second box holds text that goes after it. Spaces you type count, so a prefix of a dash and a space turns apple into - apple. Each box takes up to 200 characters, and anything longer is cut. Leave one box empty to add text on one side only. The page opens with a double quote before and a double quote plus comma after, so a plain list of words becomes a list of quoted, comma-ended items. The new text is added outside the line. What is already in the line is never changed, including spaces at its start or end.

Blank lines

Skip blank lines is on by default. A blank line is one that is empty or holds only spaces and tabs. Those lines are copied unchanged, so a gap between two groups stays a gap and does not turn into a line with only quotes and a comma. Turn the option off to add your text to every line, blank ones too. The first number under the result, Lines changed, counts only the lines that received text, so with skipping on it can be smaller than the number of lines you pasted.

Line endings and the end of the text

Windows, old Mac and Unix line endings each count as one line break, and the result uses a single plain line break. If your text ends with a line break, that final empty line is a line like any other: it stays empty while skipping is on, and receives the prefix and suffix when skipping is off. An empty box gives an empty result. A result that would be over 5,000,000 characters is not built; a message asks you to use fewer lines or shorter additions. Letters from any alphabet, accents and emoji are passed through exactly as typed, and the added text is placed as you typed it.

What this tool does not do

It adds the same text to every line. It does not number the lines, and it has no placeholders or per-line values. To number lines, use the line numbering tool. To join the lines into one comma separated row, use the delimiter converter. The work happens in your browser, in this tab. No server receives your list, and the list is not saved or put in the page address. Only your two boxes and the skip choice are remembered in this browser. Text up to 1,000,000 characters is handled; longer text shows a message asking you to split it.

Frequently asked questions

How do I put quotes and a comma on every line?

Type a double quote in the first box and a double quote followed by a comma in the second. The page opens with exactly that. So apple becomes "apple", on its own line. For single quotes, type a single quote in each box.

Why was my empty line left alone?

Skip blank lines is on. A line that is empty, or holds only spaces and tabs, is copied as it is. Switch the option off if you want the prefix and suffix on those lines too.

Are spaces in the prefix kept?

Yes. A prefix of two spaces indents every line by two spaces, and a suffix of a space and a semicolon gives a trailing space before the semicolon. Each box holds up to 200 characters.

Can I add different text to different lines?

No. The same prefix and suffix go on every line that is not skipped. To number lines instead, use the line numbering tool, which counts up from a start number you choose.

Is my list uploaded?

No. The lines are processed in your browser, in this tab, and no server receives them. Your prefix, suffix and skip choice are saved in this browser, but the list itself is not, so closing the tab clears it.