Besides creating, editing, and reading text documents in TextEdit on Mac, you can work with HTML files. Let’s see how to use TextEdit for HTML on Mac, from creating a new file to always opening files in code editing mode.

What is TextEdit on Mac?

TextEdit is a word processing and editing application that comes preinstalled with macOS. You can use it to work with text documents created in applications such as Microsoft Word. You can also use it for simple text documents, and it’s ideal for HTML markup and editing.

  • You can find TextEdit in your Applications folder. To access it, make sure Finder is active. Then select Go from the menu bar → select Applications → double-click TextEdit to open the application.
  • Alternatively, you can invoke Spotlight (cmd + spacebar) -> find and open TextEdit.

How to create an HTML file in TextEdit on Mac

  1. Open the TextEdit app on your Mac as shown above.
  2. First, you will see the TextEdit dialog open. Select New Document.


  3. If the new document opens in rich text mode, you will need to change it to plain text.
    Rich text mode displays the editing toolbar at the top, while plain text does not.
  4. Go to “Format” in the menu bar → select “Make Plain Text”.


  5. You can then enter or paste your HTML code from elsewhere or from the clipboard.
  6. To save the file, go to File in the menu bar and select Save.

    Select Save from TextEdit on Mac.

  7. Enter the file name followed by the HTML extension. For example, “name.html”. Then choose a location for the saved file and optionally add tags.
  8. Select Save.

    Enter the file name followed by the HTML extension on Mac

  9. When prompted, click Use .html to save the file as HTML.


From now on, every time you open a file and save your changes, it is automatically saved with the HTML file extension.

Pro tip: If you want to view an HTML document in your default browser, simply double-click the file.

How to open an HTML file in TextEdit on Mac

Opening an HTML file in TextEdit is not as easy as you think. Double-clicking the file will open it in the browser, while right-clicking and selecting Open With → TextEdit will open it in RTF format.

  1. To properly open an HTML file for editing, first launch the TextEdit application.
  2. Navigate to the location of the file, but don’t select it yet. First, select Show Options at the bottom of the dialog box.


  3. Check the “Ignore Rich Text Commands” box.
  4. Then select the file and click “Open”.

    Open the HTML file in TextEdit on Mac

You should then see the HTML file open in text format and ready for editing.

Change preferences in TextEdit on Mac

To avoid having to make the above settings each time you create or open an HTML file in TextEdit, you can change some of the settings. This will save time when working with HTML documents in the application in the future.

Always open files in HTML edit mode

If you want plain text files to open in rich text format, but HTML files to open in plain text (encoding mode), this is a small change.

  1. Open TextEdit → select TextEdit from the menu bar → select Preferences.


  2. Click the “Open and Save” tab.
  3. Check the box at the top to display HTML files as HTML instead of rich text.
  4. You can then close Settings or continue below with more changes.

    Always open files in HTML edit mode on a Mac

From now on, when you open an HTML file in TextEdit, it will appear in the correct format for editing.

Change how HTML files are saved

If you are using a specific document type, CSS setting, or markup style, you can also change these settings for TextEdit.

  1. Select TextEdit from the menu bar → select Preferences → go to the Open and Save tab.
  2. Use the boxes in the HTML Save Options section at the bottom to specify the document type, style (for CSS), and encoding.
  3. Then check the “keep white space” checkbox to keep the white space in the document.

    Change how HTML files are saved on Mac

Set other options in TextEdit

There are many other settings that can help you when using TextEdit.

Select TextEdit from the menu bar → choose Preferences → go to the New Document tab and try the following:

  • At the top, you can select Plain Text as the default text when you open a new document.
  • Below you can set a specific window size and specify the font style and size for both plain and formatted text documents.
  • You can then set document properties, including author, organization, and copyright, to rich text documents.
  • Finally, you can check boxes for additional options like checking spelling and grammar, using only quotes and smart dashes in rich text documents, and enabling data detectors.

Set other options in TextEdit on Mac

When done, just close Preferences and reopen TextEdit to see the changes.

Are you going to try TextEdit on Mac?

While you could always use a third-party HTML editor, TextEdit on Mac is easy to use and free and comes with macOS, so it’s definitely worth a try.

What do you think about using TextEdit on Mac for HTML? Are you going to give it a try or have you already done so and want to share your thoughts?

Read more:

  • Best HTML editing apps for iPad
  • How to compress PDF files on Mac
  • Best IDE apps for Mac