HTML Editor with Autocomplete
Type < and pick a tag from the list, get attribute suggestions inside tags, and expand Emmet abbreviations such as ul>li*3 with Tab. Closing tags are added for you, and the preview updates as you type.
Write HTML with autocomplete
Click into the editor and type < to see tag suggestions. Press Ctrl+Space for suggestions anywhere, Tab to expand an Emmet abbreviation, and watch the preview update.
The editor is built on CodeMirror and Emmet, both open source, loaded into this page. Suggestions come from built-in lists of HTML tags, attributes and CSS properties, so nothing you type is sent anywhere.
What autocomplete does for you
Autocomplete is not only about typing less. It also stops typos and shows you options you did not know existed.
Typing < opens a list of HTML elements that narrows as you type; Tab or Enter inserts the one you choose. Inside an opening tag, a space brings up that element's attributes, and for attributes with a fixed set of values, such as type on an input, the values are suggested too. That is a quick way to explore: type <input type=" and the list shows every input type the browser understands.
With Close tags automatically on, finishing an opening tag with > inserts the matching closing tag after the cursor, and typing </ completes the name of the element that is still open. Both remove a common source of broken layouts: an element that is opened and never closed.
Inside a style element, the editor switches to CSS and suggests property names as you type them. Emmet, described below, works in both HTML and CSS. Everything runs in your browser, and the preview next to the editor shows the result of each change.
Tag and attribute hints
Lists of elements, attributes and fixed values appear as you type.
Closing tags for you
Opening tags get their closing partner, and </ finishes the open element.
Emmet shorthand
Short abbreviations expand into full, correctly nested markup with Tab.
Emmet abbreviations to try
Type each abbreviation on its own line in the editor above and press Tab. The comments show what you get.
Emmet reads abbreviations like a CSS selector: > puts the next element inside the previous one, + places it next to it, * repeats it, a dot adds a class, # adds an id and square brackets add attributes. ! on an empty line produces a complete HTML5 page.
Plain words only expand when they are HTML element names, so pressing Tab after ordinary text still indents instead of turning a word into a tag. In CSS, abbreviations such as m10 or d:f expand into full declarations.
ul>li*3 <!-- <ul> with three empty <li> -->
nav>a[href=#]*3 <!-- <nav> with three links -->
div.card>h2+p <!-- <div class="card"> with <h2> and <p> -->
section#about <!-- <section id="about"></section> -->
img[alt] <!-- <img src="" alt=""> -->
! <!-- a complete HTML5 page -->
/* inside <style> */
m10 /* margin: 10px; */
d:f /* display: flex; */Keys to remember
Four keys cover almost everything in this editor.
< for tags
Typing < opens the tag list. Keep typing to narrow it down.
Ctrl+Space anywhere
Opens suggestions on demand, for tags, attributes, values or CSS properties.
Tab or Enter to accept
Inserts the highlighted suggestion; the arrow keys move through the list and Esc closes it.
Tab to expand Emmet
With no list open, Tab expands the abbreviation before the cursor, or indents if there is none.
Ctrl+Enter, or Cmd+Enter on a Mac, saves the current code as an HTML file.
Autocomplete in other editors
The same ideas carry over, with small differences in keys.
This page
One file, no setup, with tag hints, automatic closing tags and Emmet on Tab.
HCODX editor
Autocomplete and snippets as you type; Emmet can be switched on in Editor Settings.
VS Code
IntelliSense suggestions and Emmet are built in; accept an Emmet suggestion with Tab or Enter.
HTML autocomplete questions
Ready for a bigger project?
The HCODX editor brings autocomplete and snippets to multi-file projects, with a live preview and ZIP export.
Instant HTML Runner & Viewer with Live Preview
Need to run a short HTML, CSS and JavaScript snippet? The HTML Runner Online has a focused editing surface with live output.
Open HTML Runner Online