Skip to main content

Line Affixer

Add a prefix and/or suffix to every line of text at once. Great for wrapping lines in quotes, building SQL IN-lists, adding bullets, or numbering lines. Use {n} in the prefix or suffix to insert the line number.

Input

Settings

Use {n} to insert the line number.

Use {n} to insert the line number.

Format for the {n} token.

Strip leading/trailing whitespace from every line first.

Drop blank lines instead of keeping them.

Output

New Text
Was this helpful?

Guides

The Line Affixer adds a prefix and/or a suffix to every line of your text in one pass. Paste a list, type what you want in front of and behind each line, and copy the result. It is built for the small, repetitive text chores that are tedious by hand: wrapping each line in quotes, building a SQL IN (...) list, turning plain lines into Markdown bullets, or numbering a list.

How to use it

  1. Paste your text into Original Text — one item per line.
  2. Type a Prefix (added before each line) and/or a Suffix (added after each line). Either can be left blank.
  3. Optionally use the token {n} inside the prefix or suffix to insert the line number, and pick a Numbering format for how that number looks.
  4. Toggle Trim each line to strip surrounding whitespace, and Skip empty lines to drop blank lines from the result.

The output updates as you type. Use the copy or download buttons on the result, or send it straight into another tool.

Examples

  • Wrap in quotes for SQL: prefix ', suffix ', turns 10 / 20 / 30 into '10', / '20', / '30',.
  • Markdown bullets: prefix - turns each line into a list item.
  • Numbered list: prefix {n}. produces 1. First, 2. Second, 3. Third.
  • Zero-padded IDs: prefix item-{n} with the 001, 002, 003 format produces item-001, item-002, …

How does {n} numbering work?

{n} is replaced with a running line number. The Numbering dropdown controls the style:

  • 1, 2, 3 — counts from one, no padding.
  • 0, 1, 2 — counts from zero.
  • 01, 02, 03 and 001, 002, 003 — count from one, padded with leading zeros.
  • 00, 01, 02 and 000, 001, 002 — count from zero, padded.

Only lines that actually receive a prefix/suffix are counted, so a blank line in the middle of your list never skips a number.

What happens to empty lines?

With Skip empty lines on (the default), blank lines are removed from the output and are not numbered. Turn it off to keep blank lines in place — they are passed through untouched, never wrapped with the prefix or suffix. A trailing blank line at the end of your input follows the same rule.

Privacy

Everything runs entirely in your browser. Your text is never uploaded to a server.

textlinesprefixsuffixbulk editline numberingwrap lines

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/line-affixer \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "inputText": "apple\nbanana\ncherry",
    "prefix": "- ",
    "suffix": "",
    "numberingFormat": "1",
    "trimLines": "",
    "skipEmptyLines": "true"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `line-affixer` tool (Line Affixer) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.