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· Your data stays in your browser.
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?
- Paste your lines, one per line.
- Type a prefix and/or suffix, for example " and ",. Use {n} where you want the line number.
- 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:
apples bananas cherries
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.
Related tools
Trim Lines
Remove the spaces and tabs at the start and end of each line of a list or block of text.
Text Tools
Find and Replace
Search a block of text and replace every occurrence, as plain text or with a regular expression and capture groups.
Text Tools
Remove Empty Lines
Strip blank lines from pasted text in one click, or keep a single blank line between paragraphs.
Text Tools
Sort Lines
Order any list one item per line: A to Z, Z to A, natural, numeric or by length.
Text Tools
CSV to JSON Converter
Turn CSV rows into clean JSON in one step, with typed values, custom delimiters and pretty or minified output.
JSON & Data
JSON Escape
Turn any text, even a whole JSON document, into a safe string you can embed inside another JSON value.
JSON & Data