Turn TextEdit Into an HTML Source Viewer with a Simple Settings Change

Jan 14, 2013 - 2 Comments

TextEdit icon TextEdit is a reasonably decent text editing app that has been bundled along with just about every version of OS X since the beginning. If you’ve ever opened an HTML file with TextEdit you have probably discovered the app actually renders the HTML code, displaying the formatted text, rather than displaying the source itself. This is actually really simple to adjust, and all it takes is a settings change to turn TextEdit into an HTML code viewer rather, and as a side effect, a simple plain text code editor.

Change TextEdit to Display HTML Files as Code Rather Than Rendered Formatted Text

This is available in all modern versions of OS X:

  1. Open TextEdit and pull down the TextEdit menu to select Preferences
  2. Click the “Open and Save” tab and check the box next to “Display HTML files as HTML code instead of formatted text”

TextEdit View HTML Source Code

Open any HTML document into TextEdit to see the new document code and source view in place of rendered code.

View HTML Source with TextEdit

The default font size for plain text documents like HTML is set to 11, which can be very small for some resolutions and screens like the 11.6″ MacBook Air. Extend the readability by adjusting that through “Preferences” and under the “New Document” tab click “Change” alongside the ‘Plain text font’ option – Menlo Regular 12 is quite a bit more readable, but adjust it as your eyes see fit.

Developers will find this is infinitely better than the default rendered HTML view, but it doesn’t offer syntax highlighting and other powerful features that those who work with the web generally need. If you’re serious about viewing source or changing code of any kind, do yourself a huge favor and download TextWrangler, it is by far the best free text editor for the Mac platform, it has syntax highlighting and SFTP support along with tons of other features, and it’s completely free.


Related articles:

Posted by: William Pearson in Mac OS, Tips & Tricks


» Comments RSS Feed

  1. Cosmin C says:

    I would say SublimeText2 is BY FAR the best text editor, on ALL platforms !!

  2. Gee Deezy says:

    Might be a Mountain Lion specific option.

    In Lion, the option is
    “Display HTML files as HTML code instead of formatted text” not what you have shown.

Leave a Reply


Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks


iPhone / iPad



Shop on Amazon to help support this site