A simple text editor is all you need to learn HTML.
Learn HTML Using Notepad or TextEdit
Web pages can be created and modified by using professional HTML editors.
However, for learning HTML we recommend a simple text editor like Notepad [PC] or TextEdit [Mac].
We believe that using a simple text editor is a good way to learn HTML.
Follow the steps below to create your first web page with Notepad or TextEdit.
Step 1: Open Notepad [PC]
Windows 8 or later:
Open the Start Screen [the window symbol at the bottom left on your screen]. Type Notepad.
Windows 7 or earlier:
Open Start > Programs > Accessories > Notepad
Step 1: Open TextEdit [Mac]
Open Finder > Applications > TextEdit
Also change some preferences to get the application to save files correctly. In Preferences > Format > choose "Plain Text"
Then under "Open and Save", check the box that says "Display HTML files as HTML code instead of formatted text".
Then open a new document to place the code.
Step 2: Write Some HTML
Write or copy the following HTML code into Notepad:
My First Heading
My first paragraph.
Step 3: Save the HTML Page
Save the file on your computer. Select File > Save as in the Notepad menu.
Name the file "index.htm" and set the encoding to UTF-8 [which is the preferred encoding for HTML files].
Tip: You can use either .htm or .html as file extension. There is no difference; it is up to you.
Step 4: View the HTML Page in Your Browser
Open the saved HTML file in your favorite browser [double click on the file, or right-click - and choose "Open with"].
The result will look much like this:
W3Schools Online Editor - "Try it Yourself"
With our free online editor, you can edit the HTML code and view the result in your browser.
It is the perfect tool when you want to test code fast. It also has color coding and the ability to save and share code with others:
Example
Page
Title
This is a Heading
This is a paragraph.
Try it Yourself »
Click on the "Try it Yourself" button to see how it works.
W3Schools Spaces
If you want to create your own website and save your code online, try our free website builder, called W3schools Spaces:
In this article, I will show how to create, open, and edit HTML files in TextEdit.
What is TextEdit?
TextEdit is a free word processor that comes preinstalled with your Mac computer. It has been around for over 25 years and it is an easy way to open and read word files, text files and even HTML files.
How to create an HTML file in TextEdit
- Go to Finder > Applications > TextEdit. Double click on TextEdit to open.
2. Click on Format and click Make Plain Text.
3. Add a basic HTML boilerplate to your file.
TextEdit Demo
This is a demo
4. Go to File > Save...
5. Name your file with the .html
extension. That will tell the computer it is working with an HTML file. Click Save.
6. Click on Use .html
Go to that newly created file on your computer and double click to open in the browser. You should see this result:
There are two ways to open an HTML file in TextEdit.
Option 1
Go to the HTML file you want to open, right click on the file, and choose TextEdit to open.
Option 2
Open TextEdit and click File > Open... You can also hover your mouse over the Open Recent option if you have opened that file recently.
TextEdit's code editing mode
There is an option in TextEdit to always display your HTML files as HTML code.
- Click on TextEdit > Preferences...
2. Click on Open and Save:
3. Click the checkbox that says Display HTML files as HTML code instead of formatted text:
Now you can make changes to your HTML file and see the results in the browser.
TextEdit Demo
This is a demo
Adding more to my demo file
That is how you create, save, open and edit HTML files in TextEdit.
Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started