HTML Basics
HTML Editors
You can write HTML in any text editor, but a good code editor makes the job far easier with colour highlighting and error hints. Here are your options and how to get started.
What is an HTML Editor?
An HTML editor is a program you use to write HTML code. It can be as simple as a plain text editor or as powerful as a professional code editor with autocomplete, live preview, and extensions.
Popular Editors
| Editor | Best for | Cost |
|---|---|---|
| VS Code | Beginners and professionals alike; huge extension library | Free |
| Sublime Text | Fast, lightweight editing | Paid (free trial) |
| Notepad (Windows) | Absolute basics with zero setup | Free |
| TextEdit (Mac) | Quick edits on macOS (use plain-text mode) | Free |
| CodePen | Trying HTML online in your browser | Free |
Write and Save Your First File
- Open your editor and create a new file.
- Type or paste some HTML code.
- Save the file with a .html extension, for example page.html.
- Double-click the saved file to open it in your browser.
<!DOCTYPE html>
<html>
<body>
<h1>My editor works!</h1>
</body>
</html>💡
If you use Notepad, choose 'All Files' in the Save dialog and type the full name hello.html, otherwise it may be saved as hello.html.txt by mistake.
