Fixed-width text formatter
Split every line of text into fixed-width rows by Unicode code points: choose the width (1–200), pad the last chunk with a single character for column alignment, and optionally trim each line first. Code-point splitting keeps CJK and emoji surrogate pairs intact.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Processed line by line: each line is split into chunks of at most "width" code points; blank lines are preserved.
Formatted text
Split by Unicode code points; padding applies to the last chunk of each line only, and no trailing spaces are added when padding is off.
Enter text to see the formatted result
Output rows: 0 · Padded rows: 0 · Longest row: 0
What this tool does
- Cut long paragraphs into fixed-width text for terminal previews, comment blocks or print layouts with a line-length limit
- Align data by padding the last chunk with one character so every row has the same width in a monospace environment
- Handle text with CJK punctuation or emoji: code-point splitting never cuts an emoji surrogate pair in half
Example
Input
中文按码点换行
Output
中文按 码点换 行
Width 3: at most three code points per row; a short last chunk is padded only when a padding character is set.
Frequently asked questions
Is the width measured in characters or display columns?
In Unicode code points, so one CJK character or one emoji counts as 1. Full-width characters usually occupy two terminal columns, so the visual width can differ; use a padding character and check in a monospace font when exact alignment matters.
Can an emoji be cut in half?
No half surrogate pairs: splitting uses [...line] per code point, so a single emoji such as 😀 stays intact. Combining sequences (👨👩👧, skin-tone modifiers like 👍🏽) are several code points and can still be separated — an inherent limit of the code-point convention.
Does it merge lines?
No. Input is processed line by line, blank lines are kept and chunks never cross a line break; the output row count is the sum of chunks across all lines.
How do padding and trimming behave?
The padding character can be at most one character and an empty value means no padding (so no trailing spaces). Only rows whose last chunk is shorter than the width are padded, which is what the padded-row statistic counts. With trimming enabled, each line is trimmed before splitting.
Is there a width limit?
Width must be an integer from 1 to 200; larger values raise an error instead of silently clamping to 200, so a whole document is never mistaken for one row.
Keywords:Fixed-width text formatterofflinetext