HTML Editors: Create and Preview Your First Web Page
Learn how to use a text or code editor to create an HTML file, save it with UTF-8 encoding and preview it in a browser.
Choose a text or code editor
An HTML file is plain text, so you can create one in a basic text editor or a code editor. A code editor can add syntax highlighting and helpful editing tools, but you do not need a special editor to begin.
Create and save an HTML file
- Create a new file in your editor.
- Write a basic HTML document, including a doctype, a head and a body.
- Save the file with an
.htmlextension and UTF-8 encoding. - Open the saved file in a browser. After making edits, save and refresh the browser.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My first page</title>
</head>
<body>
<h1>Welcome</h1>
<p>My first paragraph.</p>
</body>
</html>
You can also try the site's online HTML editor.