ToolHome

Home / Tools / Text Line Common Prefix Finder

Free browser utility

Text Line Common Prefix Finder

Find the longest case-sensitive prefix shared by every text line, count its Unicode code points, and remove it from all lines locally.

Find the shared start of a list

Paste file paths, identifiers, or other text with one item per line. This tool finds the longest exact prefix present at the start of every line, then shows the lines with that prefix removed. For project/src/a.js and project/src/b.js, the shared prefix is project/src/.

Whitespace, blank lines, and Unicode

Matching is case-sensitive and preserves whitespace. Every line counts, including a trailing blank line, which makes the common prefix empty. CRLF and CR line endings are normalized to LF. Unicode code points are kept whole, so an emoji is never cut in half; combining sequences are not normalized.

Read the result

The prefix is shown as a JSON string so tabs and spaces are unambiguous. A single line is its own common prefix. The output includes the prefix length and the remaining lines. Input is limited to 200,000 UTF-16 code units and stays in your browser.

Related tools