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.
Create your HTML file
Change any option and the file on the right updates straight away. When it looks right, select Create and download.
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.
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 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.
<!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>© 2026 Your name</p>
</footer>
</body>
</html>From an empty folder to a page in your browser
Five minutes is enough for a first working page.
Make a folder
Create a folder for the site, for example my-site, somewhere you will find it again.
Create and download
Set the title and options above, select Create and download, and move index.html into the folder.
Add a stylesheet
Create styles.css in the same folder. Even body { font-family: system-ui; } makes a visible difference.
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.
Where to edit your new file
Any plain-text editor works. Pick by how much you plan to build.
HTML Runner
Open the file in the HTML Runner from the button above the code, and edit with a live preview and console.
HCODX editor
A file tree for several pages, stylesheets and images, with live preview and ZIP export.
Desktop editor
VS Code or any code editor. Avoid word processors, which add formatting and curly quotes that break HTML.
Creating HTML files: questions
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