🔪 Text Splitter

📝
Text will be split according to your selected method
🎯
✂️
🔍
Use PHP regex syntax with delimiters (e.g., /pattern/flags)
⚙️
Configure how elements are processed after splitting
⚡
🎨
💡
{{ getSplitTypeLabel() }}: {{ getSplitTypeDescription() }}
📤
[{{ index + 1 }}] {{ element }}
📊
Original Text:
Length: {{ stats.original.length }}
Characters: {{ stats.original.characters }}
Words: {{ stats.original.words }}
Lines: {{ stats.original.lines }}
Split Result:
Elements: {{ stats.result.elements }}
Total Length: {{ stats.result.total_length }}
Avg Length: {{ stats.result.avg_length }}
Min: {{ stats.result.min_length }} | Max: {{ stats.result.max_length }}
🏷️
Method: {{ getSplitTypeLabel() }}
Delimiter:"{{ options.delimiter }}"
Regex: {{ options.regex }}
Max Splits: {{ options.maxSplits ||'Unlimited' }}
Remove Empty: {{ options.removeEmpty ?'Yes' :'No' }}
Trim Elements: {{ options.trimElements ?'Yes' :'No' }}
💡
Delimiter (CSV):
Input:"apple,banana,cherry"
Delimiter:","
Output: ["apple","banana","cherry"]
Lines:
Input:"Line 1\nLine 2\nLine 3"
Output: ["Line 1","Line 2","Line 3"]
Regex (Numbers):
Input:"a1b2c3d"
Regex: /\d+/
Output: ["a","b","c","d"]
⚠️ {{ error }}
🔄 Processing text...

ℹ️ About Text Splitter Tool

Text Splitter Tool separates text into elements using lines, words, characters, custom delimiters, or regular expressions. Use it to break logs, lists, pasted tables, and quick data exports into smaller pieces before joining, sorting, counting, or converting them.

Common use cases:

  • Splitting CSV data by commas or other delimiters
  • Breaking text into individual words or lines
  • Parsing structured data with custom separators
  • Extracting data using regular expression patterns
  • Converting text lists to individual elements
  • Processing log files and data streams

Split methods:

  • Lines: Split by line breaks.
  • Words: Split by whitespace-style boundaries.
  • Characters: Split into individual code-unit style pieces.
  • Delimiter: Split using a custom delimiter string such as comma, pipe, or tab.
  • Regex: Split using regular expression patterns for more flexible matching.

Standards and references: JavaScript-style splitting is based on the behavior described for ECMAScript String.prototype.split. CSV-looking input can be trickier than a simple comma split because quoted fields and embedded line breaks are handled by the RFC 4180 CSV conventions.

Limitations: Regex mode is powerful but can produce surprising empty elements or very large outputs. Character splitting may not preserve grapheme clusters such as emoji with modifiers or composed accents; Unicode Standard Annex #29 explains those text boundary rules.

API Usage Example:

POST /api/tools/text/text-splitter
Content-Type: application/json

{
    "text": "apple,banana,cherry\nLine 1\nLine 2",
    "splitType": "delimiter",
    "delimiter": ",",
    "removeEmpty": true,
    "trimElements": true,
    "maxSplits": 0
}
Ready