Text Wrapping Tool

Insert hard line breaks at a chosen Unicode code-point width without removing spaces or splitting surrogate pairs.

Hard-wraps each existing line at a code-point width. May split words, combining sequences or emoji clusters; this is not visual-width wrapping.

Processing stays in this browser. Input limit: 100,000 UTF-16 code units and 10,000 logical lines per source.

Text Wrapping Tool: control text line structure

Enter source text, choose Code points per line, then select Process text. Each existing line is divided independently; original line boundaries remain boundaries.

Try the example

The example sets width to 5. ABCDEFGHIJK becomes ABCDE, FGHIJ and K on three lines. A single supplementary-plane emoji is one code point and is not split into surrogate halves. A multi-code-point emoji sequence can still be split between its members.

Exact transformation rules

Wrapping counts Unicode code points, not UTF-16 units, grapheme clusters, display columns or pixels. It does not find word boundaries. Spaces and tabs are retained and count as one code point each, so a tab is not expanded according to tab stops. Existing blank lines and a trailing newline are retained, with all separators normalized to LF.

Use this only when fixed code-point chunks are the intended format. It can break words or separate a combining mark from its base. For investigating visually combined characters before wrapping, use Grapheme Cluster Viewer.

Limits and result review

Width accepts integers from 1 to 1,000. Each input supports 100,000 UTF-16 code units and 10,000 logical lines. Unpaired UTF-16 surrogates are rejected so UTF-8 export does not silently replace them. Browser textareas may normalize CRLF or CR before processing. The output-line count includes the empty final segment when source ends in a newline.

Changing text or settings clears the old preview and download links. Processing does not overwrite a local source file. Download results before reloading if you need to keep them.

Use Unicode Code Point Inspector to inspect unexpected character sequences. Use Line Range Extractor when the task is selecting specific consecutive lines rather than changing their layout.