Skip to content
UniKit

Text wrap

Wrap text to a fixed width — English at word boundaries, Chinese between characters — keeping existing line breaks and supporting first-line and hanging indents plus optional hard breaks for very long words.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Original text
Wrap by

Wrapped output

Word wrapping never splits an English word; Chinese breaks between any two characters.

Type text to see the wrapped result instantly.

What this tool does

  • Wrap a long single-line paragraph to 80 characters so it fits in an email, a ticket or a code comment without overflowing.
  • Lay out Chinese paragraphs: there are no spaces to break on, so character wrapping is the only way to keep a fixed width.
  • Build fixed-width text blocks — ASCII cards, terminal notices, plain-text tables — with first-line and hanging indents for structure.
  • Reformat text copied from a PDF that arrives as one endless line: keep the existing breaks and only split the lines that are too long.

Example

Input

The quick brown fox jumps over the lazy dog

Output

The quick brown fox
jumps over the lazy
dog

Width 20 with word wrapping: English words are never split, so the first line stops at fox (19 characters) and the second at lazy.

Frequently asked questions

Should I wrap by word or by character?

Use word wrapping for English — words stay whole and the text reads better. Use character wrapping for Chinese or Japanese, where there are no spaces; otherwise an entire paragraph counts as one “word” and lands on a single line. Mixed text works with word wrapping too: CJK characters become individual break points while English words still move as a unit.

How is the width measured?

In characters (Unicode grapheme clusters), with emoji and combining marks counting as one. When you are aligning text in a terminal or a monospace font, enable “Count fullwidth characters as 2” so a CJK character takes two columns and the visual width actually lines up.

What is the difference between the first-line and hanging indent?

The first-line indent is added before the first line only, matching the typographic habit of indenting a paragraph opening. The hanging indent is added to every line except the first, which suits list items and bibliographies. Indentation sits outside the width limit rather than eating into it.

What happens to a very long word or URL?

Hard-breaking is on by default: a word longer than the whole line is split so no line overflows. Turn it off and such a word gets a line of its own and exceeds the width — useful when you would rather not break a URL.

Are my existing line breaks preserved?

Yes, by default: each original paragraph is wrapped separately, so the paragraph structure survives. Turn “Keep existing line breaks” off and every break is treated as a space, merging the text into one paragraph before wrapping it again.

Keywords:text wrapword wrapline breakfixed widthhanging indent文本换行自动换行定宽排版悬挂缩进首行缩进

Related tools