Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I view this IRC log in Firefox, long lines do not wrap. But I wish they would! Anyone know how to make Firefox word-wrap text/plain files?

  • this file is served as gzipped plain text; try HEAD and you should see Content-Type: text/plain
  • when the same resource is viewed in Google Chrome, long lines wrap
  • this might be a related question on doctype, but the "accepted answer" contains a broken link
  • this didn't work for me (even the alternate version using pre-wrap as opposed to -moz-pre-wrap mentioned in a comment by user "Idran")
  • using "View → Page Source", then toggling word wrap is a suitable workaround
share|improve this question
up vote 8 down vote accepted

The Toggle Word Wrap Firefox extension might work for you.

share|improve this answer
Yes, that works! I noticed that plugin, but I dismissed it since the description only mentions PRE tags and HTML, so I assumed it wouldn't work for text/plain documents. Thank you! – Adam Monsen Aug 13 '10 at 22:35
I did that too. That is, dismissed the add-on because it focused on PRE tags. Thanks Dan! – progo Nov 27 '10 at 15:18

If you just need to wrap plaintext files, try Ctrl-U (then View -> Wrap Long Lines, if not already checked). This solution is cleaner than an add-in with plaintext files, but sloppier with text embedded in html.

share|improve this answer
Not liking unnecessary plugins, this is a great solution! – sage Aug 31 '12 at 20:39

Go to the Firefox User Profile.

This is for applying a style to all web pages you view.

Firefox User Profile Folder --> Chrome -- > userContent.css (If this file is not present, make a copy of userContent-example.css and rename it!

 * This file can be used to apply a style to all web pages you view
 * Rules without !important are overruled by author rules if the
 * author sets any.  Rules with !important overrule author rules.

This is for customizing Mozilla's user interface.

Firefox User Profile Folder --> Chrome -- > userChrome.css (If this file is not present, make a copy of userChrome-example.css and rename it!

 * This file can be used to customize the look of Mozilla's user interface
 * You should consider using !important on rules which you want to
 * override default settings.

Add to the bottom:

pre { white-space: pre-wrap !important; }

Save the file.]

Restart Firefox. Works with Firefox 26.

share|improve this answer

Here is an untested possibility, but the ideal solution if using view-source:URL with [View] [wrap long lines] enabled. This would be for the text/plain mime type to automatically use:

view-source: schema

This avoids the ctrl-u or menu [page source] click and reduces manual labour in an automated computing environment.

share|improve this answer

For what it's worth, Firefox 22 (the current target as of this writing) will introduce a new feature to allow wrapping text files directly in the browser. See improved plain-text handling in Firefox for a preview, and Firefox bug 253564 for the gory details.

share|improve this answer

FF31. Open a new tab. Enter about:config. Search for wrap. You will find an entry to toggle word wrap on or off.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.