Suggest / complete / expand

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.

Tag and attribute hintsAutomatic closing tagsEmmet on Tab
Try it here

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.

Options

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.

HCODX / live preview
Autocomplete

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

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.

Abbreviation and result
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

Keys to remember

Four keys cover almost everything in this editor.

01

< for tags

Typing < opens the tag list. Keep typing to narrow it down.

02

Ctrl+Space anywhere

Opens suggestions on demand, for tags, attributes, values or CSS properties.

03

Tab or Enter to accept

Inserts the highlighted suggestion; the arrow keys move through the list and Esc closes it.

04

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.

Other editors

Autocomplete in other editors

The same ideas carry over, with small differences in keys.

Quick edits

This page

One file, no setup, with tag hints, automatic closing tags and Emmet on Tab.

Projects

HCODX editor

Autocomplete and snippets as you type; Emmet can be switched on in Editor Settings.

Desktop

VS Code

IntelliSense suggestions and Emmet are built in; accept an Emmet suggestion with Tab or Enter.

Questions

HTML autocomplete questions

It is always on. Type < to see tag suggestions, or press Ctrl+Space at any point to open the list.

Emmet is a shorthand for writing HTML and CSS quickly. You do not need it, but once you know a few abbreviations, lists, navigation bars and card layouts take seconds to type.

Check that Emmet is switched on, that the cursor is right after the abbreviation, and that you are not inside a tag or a script. Plain words only expand when they are HTML element names.

Yes, inside a style element. Start typing a property name, or press Ctrl+Space.

No. It helps you write valid tags but does not check the finished page. Use the HTML validator for that.

No. Select Save as HTML file to download it, or Open in HTML Runner to continue there, where edits are kept in your browser.

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