A prefix and a suffix on every line, in one pass
Open goes on the left of every line, Close goes on the right. The transform splits the input on \r?\n, wraps each piece, and joins with \n. Empty lines are wrapped too, so an empty input line becomes Open + Close; if you want to skip blanks, run the result through remove empty lines afterwards.
There are no scope toggles and no skip-empty switch on this tool. The behaviour is fixed: every line gets both wrappers. The simplicity is the point. If you need conditional wrapping use a regex via regex replace.
Typical recipes: build a JSON string array (Open ", Close ",), build an HTML list (Open <li>, Close </li>), or quote each item for a shell command (Open ', Close '). For multi-character padding instead of literal text, see pad left and pad right.
How to use wrap each line with text
- 1Paste your lines into the input panel on the left.
- 2Type the opening string into the Open field.
- 3Type the closing string into the Close field.
- 4Read the wrapped lines on the right.
- 5Click Copy or Download in the output header.
Keyboard shortcuts
Drive TextResult without touching the mouse.
| Shortcut | Action |
|---|---|
| Ctrl F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run a saved workflow Plus |
What this tool actually does
Both wrappers go on every line
Every line in the split result gets Open at the start and Close at the end, no exceptions. Blank lines become Open + Close on their own.
Either field can be empty
Leaving Open empty makes the tool act like an add-suffix-only transform. Leaving Close empty makes it act like add-prefix-only. Both empty is a pass-through.
Multi-character wrappers are fine
Strings of any length work. <li> and </li> for HTML lists, " and ", for JSON arrays, /* and */ for block comments. The wrappers are inserted verbatim.
Line endings are normalised on output
The split uses \r?\n and the join uses \n, so CRLF input becomes LF output. The wrappers themselves are inserted exactly as you typed them.
Runs entirely in your browser
A single split + map + join pass on every keystroke. Nothing uploads, nothing is logged.
Worked example
Open ", close ",. The output is now a comma-separated list of quoted strings ready to paste between [ and ] for a JSON array.
apple banana cherry
"apple", "banana", "cherry",
Settings reference
| Behaviour | Effect on output |
|---|---|
| Open populated, Close populated | Both wrappers attach to every line. |
| Open populated, Close empty | Acts like add-prefix-only. Same effect as add prefix in line scope. |
| Open empty, Close populated | Acts like add-suffix-only. Same effect as add suffix in line scope. |
| Open empty, Close empty | Input passes through (CRLF still becomes LF on output). |
| Blank input lines | Wrapped too. The output line is Open + Close. Drop them later with remove empty lines if needed. |
| Line endings | CRLF input becomes LF output. |
FAQ
How do I make a JSON string array?
" and Close to ",, then put [ at the top and ] at the bottom with add text to top and add text to bottom. The trailing comma on the last line is invalid JSON, so trim it manually.Why are blank lines being wrapped too?
Can I wrap each word instead of each line?
Does it support HTML?
<li> and </li> work fine. The output is plain text containing HTML markup.