Generate / download / edit

Create an HTML File Online

Fill in a title and a few options and get a complete, valid index.html with the doctype, character encoding, viewport and links already in place. Download it, copy it, or open it in the HTML Runner and keep editing.

Valid HTML5 starting pointDownloads as index.htmlNo signup, nothing uploaded
Try it here

Create your HTML file

Change any option and the file on the right updates straight away. When it looks right, select Create and download.

Options

The file is built in your browser from the options above; nothing is uploaded. The result passes this site's HTML checker. Add your content in any text editor, or open the file in the HTML Runner to keep working here.

HCODX / index.html
The basics

What every HTML file needs

A web page is a plain text file. A handful of lines at the top decide how every browser reads it.

The doctype on the first line tells the browser to use modern standards mode; without it, browsers fall back to quirks mode, where some layout rules behave like they did in the 1990s. The lang attribute on the html element names the page's language, which screen readers use to pick the right pronunciation and translation tools use to decide whether to offer a translation. The charset tag should come first inside the head so that accented letters and symbols display correctly.

The viewport tag makes phones lay the page out at their real width instead of shrinking a desktop layout. The title appears in the browser tab, in bookmarks and as the headline in search results, so make it specific. A description is optional but often shown under that headline. The stylesheet and script links connect the page to the CSS and JavaScript files you add next, and the script is deferred so it runs after the page content has loaded.

Name your home page index.html. Web servers send that file when someone visits a folder's address, so example.com/ shows example.com/index.html. Use lowercase file names without spaces, such as about.html or contact-us.html, because many servers treat About.html and about.html as different files and spaces turn into %20 in addresses.

Standards mode

The doctype keeps layout consistent across Chrome, Edge, Firefox and Safari.

Correct characters

UTF-8 encoding displays accents, symbols and emoji the way you typed them.

Ready for phones

The viewport tag lets your CSS respond to the real screen width.

The result

The file this tool creates by default

With the default options, the download looks like this. Each part is explained above.

The starter content uses semantic elements: header and nav for site navigation, main for the page's own content, and footer for the closing details. They cost nothing to use and give screen-reader users landmarks to jump between.

Replace the heading and paragraph with your own text, then create styles.css next to the file. If you choose the article layout instead, you get a heading outline with h1 and h2 elements ready to fill in.

index.html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>My first page</title>
  <link rel="stylesheet" href="styles.css">
</head>
<body>
  <header>
    <nav>
      <a href="index.html">Home</a>
      <a href="about.html">About</a>
    </nav>
  </header>

  <main>
    <h1>My first page</h1>
    <p>Write your first paragraph here.</p>
  </main>

  <footer>
    <p>&copy; 2026 Your name</p>
  </footer>
</body>
</html>
Step by step

From an empty folder to a page in your browser

Five minutes is enough for a first working page.

01

Make a folder

Create a folder for the site, for example my-site, somewhere you will find it again.

02

Create and download

Set the title and options above, select Create and download, and move index.html into the folder.

03

Add a stylesheet

Create styles.css in the same folder. Even body { font-family: system-ui; } makes a visible difference.

04

Open and refresh

Double-click index.html to open it in your browser. After each change to the files, refresh the tab to see it.

When the page is ready to share, the export and deploy guide shows how to put the folder online for free.

Next

Where to edit your new file

Any plain-text editor works. Pick by how much you plan to build.

One page

HTML Runner

Open the file in the HTML Runner from the button above the code, and edit with a live preview and console.

A small site

HCODX editor

A file tree for several pages, stylesheets and images, with live preview and ZIP export.

On your computer

Desktop editor

VS Code or any code editor. Avoid word processors, which add formatting and curly quotes that break HTML.

Questions

Creating HTML files: questions

Open a plain-text editor, paste the code and save it with a name ending in .html. In Windows Notepad, set the file type to All files so .txt is not added. In macOS TextEdit, choose Format, Make Plain Text before saving.

index.html. Servers show that file when someone visits a folder, so it becomes your home page. Name other pages in lowercase without spaces, such as about.html.

It probably ends in .html.txt with the last part hidden. Turn on file name extensions in your file manager, remove .txt and open the file again.

Yes. Every combination of options produces markup that passes this site's HTML checker. Check again after adding your own content, because that is where mistakes usually appear.

Neither is required. The description is often used as the snippet under your search result. Open Graph tags control the title and text shown when the page is shared in chat and social apps.

Yes. Create and download it here; the file is saved to your phone's downloads. Editing longer pages is easier on a computer, but the HTML Runner works on phones for small changes.

No. The file is generated in your browser and saved straight to your device. Nothing is sent to HCODX.

Turn one file into a whole site

Open the HCODX editor to add pages, stylesheets and images in a file tree, 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