Turn TextEdit into an HTML editor

TextEdit is a basic, yet useful word processor and text editor that has been bundled with OS X on the Apple Mac for many years, but do you use it for anything or is it too basic for your needs? It can sometimes be frustrating to use, such as when you try to edit an HTML file, which after all is just plain text, to make some quick changes to your website. TextEdit modifies the code and can seriously mess up any HTML file edited with it, but there is a quick and easy solution to the problem.

TextEdit preferences

TexEdit can easily be turned into a useful HTML editor with a few changes to the preferences.

If you right click on a .html file on the disk drive and select Open With, TextEdit.app, TextEdit opens and displays the file. However, it goes through a conversion process and in the page looks completely different in the TextEdit window.

Related: Use advanced print features in TextEdit

What's more, when you save the file after making changes, it rewrites the code in its own way and this is unlikely to be the way you want it. It adds lots of CSS code of its own, modifying what was already there. This could, in fact, break certain features in your website. This is what it looks like:


What you must do is open TextEdit in the Applications folder and go to TextEdit, Preferences. On the New Document tab you might want to select plain text as the default format. This means that whenever you create a new file, TextEdit won't mess with the text. What you see is what you get.

Select the Open and Save tab and then tick the box at the top - Display HTML files as HTML code instead of formatted text. You should also clear the tick against Add ".txt" extension to plain text files.


After making these changes find a .html file on the Mac's disk drive, right click it and select Open With, TextEdit.app and it now simply shows the plain text like this:


This alternative mode does not mess around with the HTML or CSS code and it makes Text Edit useful for quick and dirty changes to web pages that are on the disk drive.

Related: Use the Actions extension in TextEdit in Yosemite



Add new comment

By submitting this form, you accept the Mollom privacy policy.

Related items you will like...