Free HTML tutorial

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

  1. Create a new file in your editor.
  2. Write a basic HTML document, including a doctype, a head and a body.
  3. Save the file with an .html extension and UTF-8 encoding.
  4. 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.

Open the first-page demo (opens in a new tab)