Skip to tool

Python Split into chunks Online

Split text into fixed-size chunks and configure the separator.

The output updates as you type. The tool processes input in your browser.

Worked example

Chunks have a fixed width and can break across words. Use word wrap when word boundaries need to be kept. Native Python textwrap.wrap() wraps words by default.

Chunk length
3
Chunk ending
"\\n"
Sample input
manualsplus
Sample output
man\nual\nspl\nus\n

Using this operation in Python

The interactive result uses JavaScript. Python str stores Unicode text. Encode to bytes when an API expects UTF-8 or another byte representation.

Python reference