Science, Tech, Math › Computer Science How to Edit HTML With TextEdit Write and edit HTML on a Mac Share Flipboard Email Print Science, Tech, Math PHP Programming Perl Python Java Programming Javascript Programming Delphi Programming C & C++ Programming Ruby Programming Visual Basic View More By Jennifer Kyrnin Jennifer Kyrnin Writer University of California University of Washington Jennifer Kyrnin is a professional web developer who assists others in learning web design, HTML, CSS, and XML. Learn about our Editorial Process Updated on October 20, 2020 Reviewed by Jerrick Leger Reviewed by Jerrick Leger Jerrick Leger is a CompTIA-certified IT Specialist with more than 10 years' experience in technical support and IT fields. He is also a systems administrator for an IT firm in Texas serving small businesses. Learn about our Editorial Process If you have a Mac, you don't need to download an HTML editor to write or edit HTML for a web page. The TextEdit program ships with all Mac computers. With it, and a knowledge of HTML, you can write and edit HTML code. TextEdit, which works with files in a rich text format by default, must be in plain text mode to write or edit HTML. If you use TextEdit in rich text mode and save an HTML document with the .html file extension when you open that file in a web browser, you see the HTML code, which isn't what you want. To change how the HTML file displays in the browser, you change TextEdit to the plain text setting. You can do this on the fly or permanently alter the preferences if you plan to use TextEdit as your full-time code editor. Create an HTML File in TextEdit If you only occasionally work on HTML files, you can make the change to plain text for a single document. Open the TextEdit application on your Mac. Select File > New from the menu bar. Lifewire Select Format on the menu bar and click Make Plain Text. Confirm the plain text selection in the window that opens by clicking OK. Lifewire Enter the HTML code. For example: Lifewire Click File > Save. Type a name for the file with a .html extension and choose a location to save the file. Lifewire Click Save. Confirm you want to use the .html extension in the screen that opens. Test your work by dragging the saved file onto a browser. It should display exactly as you will see it when you publish it to the web. The example file dragged onto any browser should look like this: Lifewire Instruct TextEdit to Open HTML as HTML If you see any problems with your file, reopen it in TextEdit and make any necessary edits. If you open it in TextEdit and don't see the HTML, you need to make one more preference change. You only need to do this once. Go to TextEdit > Preferences. Lifewire Click the Open and Save tab. Lifewire Put a check in the box next to Display HTML files as HTML code instead of formatted text. If you're using a version of macOS older than 10.7, this option is called Ignore rich text commands in HTML pages. Changing the TextEdit Default Setting to Plain Text If you plan to edit lots of HTML files with TextEdit, you might prefer to make the plain text format the default option. To do that, go to TextEdit > Preferences and open the New Document tab. Click the button next to Plain text. Cite this Article Format mla apa chicago Your Citation Kyrnin, Jennifer. "How to Edit HTML With TextEdit." ThoughtCo, Sep. 30, 2021, thoughtco.com/edit-html-with-textedit-3469900. Kyrnin, Jennifer. (2021, September 30). How to Edit HTML With TextEdit. Retrieved from https://www.thoughtco.com/edit-html-with-textedit-3469900 Kyrnin, Jennifer. "How to Edit HTML With TextEdit." ThoughtCo. https://www.thoughtco.com/edit-html-with-textedit-3469900 (accessed May 31, 2023). copy citation