Skip to content

Add Prefix / Suffix to Lines

Put the same text at the start and end of each line, or number the lines automatically.

Processed locally in your browser

Options

Use {n} for a line number and \t for a tab.

{n} works here too.

0 chars · 0 lines
The result will appear here.

What is Add Prefix / Suffix to Lines?

This tool adds a prefix, a suffix or both to every line of a list. It turns plain values into quoted, comma-terminated array items, SQL IN lists, Markdown bullets, HTML list items or numbered steps without a script.

Use the {n} token in the prefix or suffix to insert a running number. Set the first number and a zero-padding width to get 001., 002., … Empty lines can be skipped so they are not numbered, and \t inserts a tab.

How does it work?

  1. Paste your lines, one per line.
  2. Type a prefix and/or suffix, for example " and ",. Use {n} where you want the line number.
  3. Set the starting number and padding if you use {n}, choose whether to skip empty lines, then copy the result.

Common use cases

  • Turning a list of words into a quoted, comma-separated array literal.
  • Adding "- " to make a Markdown bullet list, or "<li>" and "</li>" for HTML.
  • Numbering steps as "1. ", "2. " or zero-padded IDs like "item-007".
  • Building one-line-per-record SQL, shell or CSV snippets.

Examples

Try this input in the tool above:

Input
apples
bananas

cherries
Output
1. "apples",
2. "bananas",

3. "cherries",

Privacy

Add Prefix / Suffix to Lines runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

The text is added literally. It does not escape quotes or special characters already present inside your lines.

Frequently asked questions

How do I number lines?

Write {n} in the prefix or suffix, for example "{n}. ". Set the first number and, if you want 001, a padding width of 3.

Can I add a tab?

Yes, type \t in the prefix or suffix and it becomes a real tab character. Use \\ for a literal backslash.

More tools in Text Tools →