Back to Tools

Wrap Text

Break long lines of text at specific character lengths

0
0
0
Input Text

Break long lines at a fixed width

Plain-text emails, commit messages, README files, code comments and terminal output often expect lines of no more than a set number of characters, commonly 72 or 80. A long paragraph pasted into those places runs off the edge or gets cut awkwardly. This tool inserts line breaks so that no line goes past the limit you choose.

How to wrap your text

  1. Paste or type your text into the Input Text box. Sample loads a sentence of placeholder text, and Paste reads the clipboard.
  2. Set the number next to Wrap at. The default is 80 and the smallest allowed value is 1.
  3. Decide about Break words, which is off by default.
  4. Press Wrap Text, then use Copy or .TXT (saved as wrapped-text.txt).

Word-boundary wrapping versus breaking words

With Break words off, the tool looks for the last space at or before the limit and cuts there, so words stay whole. If a single word is longer than the limit, such as a long URL, it has no space to cut at, and the tool then cuts at the limit anyway. With Break words on, every long line is cut at exactly the limit, even in the middle of a word. Use that mode when you need strictly fixed-width blocks, for example for data columns or ASCII layouts.

Where it is useful

  • Formatting an email draft for clients that show plain text at 72 columns.
  • Preparing a long description for a commit message body or source-code comment.
  • Fitting text into a fixed-width area, a printed slip or a narrow display.
  • Making pasted prose readable in a terminal or a monospaced code block.

Behavior worth knowing

  • Existing line breaks are respected. Each line is checked separately, and lines already shorter than the limit are left as they are.
  • The tool only adds breaks. If your text already has short hard-wrapped lines, run it through Unwrap Text first to get an even result.
  • Spaces at the point of a cut are trimmed, so new lines do not start with a stray space.
  • The limit counts characters, not pixels, so it suits monospaced output better than proportional fonts.

Character, word and line counts are shown before and after, and the summary confirms the width used. Everything runs in your browser page as JavaScript.


Related Tools

Related Tools


Frequently Asked Questions

What is the default wrap width?
The Wrap at field starts at 80 characters. You can change it to any whole number of 1 or more, such as 72 for email or 100 for code comments. If the field is empty or invalid it falls back to 80.
What does Break words do?
When ticked, lines are cut at exactly the chosen length, even if that splits a word. When unticked, the tool breaks at the last space before the limit and only cuts inside a word if there is no space available.
Will it merge my short lines together?
No. It only inserts breaks into lines that are too long. Short lines are kept as they are and existing line breaks stay. Use the Unwrap Text tool first if you want to reflow everything evenly.
What happens to very long words or URLs?
A single word longer than the limit has no space to break at, so it is cut at the limit and the rest continues on the next line. That can split a URL, so check links after wrapping.
Does wrapping work with tabs or indentation?
Each line is measured by character count, tabs count as one character, and leading spaces at a break point are trimmed. Indentation on continuation lines is not preserved, so this is best for prose rather than indented code.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.