TExcelTAD
Home › HTML › HTML Editors

HTML Editors

You do not need special software to write HTML. A web page is just a plain text file with the extension .html. Any program that can save plain text can create one — but a good editor makes the work much more pleasant.

Plain text editors

Every operating system ships with a basic text editor:

System Built-in editor Note
Windows Notepad Choose "Save as type: All files" and encoding UTF-8
macOS TextEdit Switch to plain text first: Format → Make Plain Text
Linux gedit, Kate, nano Already save plain text by default

Note: Word processors such as Microsoft Word or Google Docs are not suitable. They save formatting information alongside your text, and the browser cannot read that as HTML.

Code editors

Most web developers use a code editor. These are free and add features that save time:

  • Syntax highlighting — tags, attributes and text appear in different colours, so mistakes stand out.
  • Auto-closing tags — type <p> and the editor adds </p> for you.
  • Emmet abbreviations — type ul>li*3 and press Tab to expand it into a list with three items.
  • Live preview — the page reloads in the browser every time you save.

Popular choices include Visual Studio Code, Sublime Text, Zed and WebStorm. There are also online editors — like the playgrounds on this site — where you type on the left and see the result immediately.

Creating your first file step by step

  1. Open your editor and create a new file.
  2. Type (or paste) the HTML below.
  3. Save it as index.html. Make sure the extension is .html, not .txt.
  4. Find the file in your file manager and double-click it. It opens in your default browser.
html · try it yourself
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>Saved from my editor</title>
  </head>
  <body>
    <h1>It works!</h1>
    <p>I wrote this file in a text editor and opened it in a browser.</p>
  </body>
</html>

When you change the file, save it and press F5 (or Cmd+R on a Mac) in the browser to reload and see the update.

File names and extensions

Extension Meaning
.html The standard extension for web pages
.htm An older, shorter form — works exactly the same
index.html A special name: web servers show it automatically when you visit a folder

Tip: Use lowercase file names without spaces, e.g. about-me.html instead of About Me.html. Web servers on Linux treat About.html and about.html as different files, and spaces turn into %20 in addresses.

Viewing the source of any page

Browsers let you look at the HTML behind any website:

  • View source: right-click a page and choose View Page Source (or press Ctrl+U). This shows the HTML exactly as it was downloaded.
  • Developer tools: right-click any element and choose Inspect (or press F12). This shows the live document, lets you edit it temporarily and see the CSS applied to each element.

Inspecting real websites is one of the fastest ways to learn. Try it on this page!

Using the playgrounds here

Every example marked with ▶ Run is a tiny editor. You can change anything and run it again. The result is drawn in a sandboxed frame, so nothing you write can break the site. Experiment freely:

html · try it yourself
<h1>Change me!</h1>
<p>Edit this sentence, then press Run (or Ctrl+Enter).</p>
<p>Try adding a third paragraph below.</p>

Test yourself

Which extension should an HTML file have?

  1. .txt
  2. .doc
  3. .html
  4. .web

Why is a word processor like Microsoft Word a poor choice for writing HTML?

  1. It cannot type angle brackets
  2. It saves extra formatting data instead of plain text
  3. It only works offline
  4. It is too slow

Which file name does a web server usually show automatically for a folder?

  1. home.html
  2. main.html
  3. default.txt
  4. index.html