Skip to content
UniKit

Text inserter

Insert a string at chosen positions on every line: 1-based positions, negative indexes counting from the end, code-point accurate for CJK and emoji, several positions at once, keyword or regex line filtering, plus line and insertion counts.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Text
Insert

Only matching lines

Ignore case
Skip empty lines

Result

Processed line by line. Positions count Unicode code points, so a CJK character or an emoji is one character.

Enter text and the string to insert to see the result

Lines

0

Lines changed

0

Insertions

0

Lines skipped

0

Characters

0

UTF-8 bytes

0

What this tool does

  • Insert a separator at the same spot on a whole column of phone numbers, card numbers or order IDs — for example a dash at position 4
  • Bulk-add characters at the start or end of every line: quotes, semicolons or the JSON commas; position -1 inserts before the last character
  • Only touch the lines you mean to: filter by keyword or regular expression and leave every other line untouched

Example

Input

13800000000
13900000000

Output

138-00000000
139-00000000

The preset uses “insert -” at position 4 (before the 4th character): every line gains a dash between the first three and the remaining eight digits.

Frequently asked questions

How are positions counted — why not 0-based?

Positions start at 1: 1 is the start of the line, 4 is the fourth character. Negative values count from the end, where -1 is the last character and -2 the second to last. Insertion happens before the target character by default; switch “Insert” to “after” to place it behind that character.

What happens when a position is past the end of a line?

It clamps to the start or the end instead of failing: with a 2-character line and position 9 the text is appended, and negative values clamp to the start the same way. That lets one position list work across lines of different lengths.

Do several positions on one line interfere with each other?

No. Positions are resolved first and applied from the last one backwards, so earlier insertions never shift later ones, and duplicate positions are applied once. Every position must be a non-zero integer — 0 is rejected.

How do I limit the insertion to certain lines?

Use the “Only matching lines” box with a keyword (substring) or switch to a regular expression, optionally case-insensitive. Non-matching lines pass through unchanged and the “Lines skipped” statistic counts them; “Skip empty lines” ignores blank lines entirely. An invalid regex reports an explicit error instead of failing silently.

Can CJK text or emoji be broken apart?

No. Positions count Unicode code points, so a CJK character or an emoji such as 😀 (two UTF-16 code units) counts as exactly one character, and the insertion always lands between whole characters.

Keywords:insert text at positioninsert characters into linesadd prefix per linetxt-insert

Related tools