How to Use TextEdit on Mac to Create and Edit HTML Files

Along with 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 one to always opening files in code editing mode.

What is TextEdit on Mac?

TextEdit is a text 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, which is ideal for HTML coding and editing.

  • You can find TextEdit in your Applications folder. To access it, make sure the Finder is active. Then select “Go”from the menu bar → select “Applications”→ double-click TextEdit to open the application.
  • Alternatively, you can call 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 described above.
  2. First, you will see the TextEdit dialog box open. Select New Document.
  3. If the new document opens in rich text mode, you need to change it to plain text. Rich text mode displays the editing toolbar at the top, while plain text mode does not.
  4. Go to “Format”in the menu bar → select “Make Plain Text”.
  5. You can then enter your HTML code or paste it from somewhere else or the clipboard.
  6. To save the file, go to “File”in the menu bar and select “Save”.
  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.
  9. When prompted, click Use. html”to save the file in HTML format.

Moving forward, 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, just 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 might think. Double-clicking a file will open it in the browser, while right-clicking and choosing 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 do not 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”.

You should then see an HTML file opened in text format, ready to be edited.

Change preferences in TextEdit on Mac

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

Always open files in HTML editing mode

If you want to open plain text files in rich text format, but open HTML files in plain text format (encoding mode), this is a simple 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 for Display HTML files as HTML instead of rich text.
  4. You can then close the settings or continue below with more changes.

Moving forward, 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 coding 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 select the document type, style (for CSS), and encoding.
  3. Then check the “Keep White Space”checkbox to keep the white space in the document.

Adjust other options in TextEdit

There are several 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 mark Plain Text as the default when opening a new document.
  • Below you can set a specific window size and select the font style and size for both plain and rich text documents.
  • You can then assign document properties, including author, organization, and copyright, to rich text documents.
  • Finally, you can check the boxes for additional options such as checking spelling and grammar, using smart quotes and dashes only in rich text documents, and enabling data detectors.

When you’re done, just close Preferences and reopen TextEdit to see your changes.

Will you try TextEdit on Mac?

While you can always use a third-party editor for HTML, TextEdit on Mac is handy, 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 try it or have already done it and want to share your thoughts?

CDN CTB