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
- Open the TextEdit app on your Mac as shown above.
- First, you will see the TextEdit dialog open. Select New Document.
- 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. - Go to “Format” in the menu bar → select “Make Plain Text”.
- You can then enter or paste your HTML code from elsewhere or from the clipboard.
- To save the file, go to File in the menu bar and select Save.
- 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.
- Select Save.
- 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.
- To properly open an HTML file for editing, first launch the TextEdit application.
- Navigate to the location of the file, but don’t select it yet. First, select Show Options at the bottom of the dialog box.
- Check the “Ignore Rich Text Commands” box.
- Then select the file and click “Open”.
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.
- Open TextEdit → select TextEdit from the menu bar → select Preferences.
- Click the “Open and Save” tab.
- Check the box at the top to display HTML files as HTML instead of rich text.
- You can then close Settings or continue below with more changes.
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.
- Select TextEdit from the menu bar → select Preferences → go to the Open and Save tab.
- Use the boxes in the HTML Save Options section at the bottom to specify the document type, style (for CSS), and encoding.
- Then check the “keep white space” checkbox to keep the white space in the document.
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.
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