HTML basics

What Is an HTML File? How to Open, View, and Share One

An HTML file is the plain-text file that tells a browser what to display on a web page. This guide explains what's inside a .html file, the three ways to open one, and how to turn a local HTML file into a link you can share.

What is an HTML file?

HTML stands for HyperText Markup Language — the standard language every web page is written in. A file ending in .html contains that markup as plain text: headings, paragraphs, links, images, and structure, written as tags like <h1>, <p>, and <a>.

The file itself is not the page you see. A browser reads the file, interprets the tags, and renders the visual result. Double-click a .html file on your computer and your browser opens it exactly like a website.

What's inside a .html file

Open a .html file in any text editor and you'll see readable source code rather than a binary format.

  • A doctype declaration and an <html> root element
  • A <head> section with the page title, meta description, and links to CSS stylesheets
  • A <body> section with the visible content: text, images, links, and buttons
  • References to external assets — CSS, JavaScript, and images are usually separate files loaded by relative path

How to open an HTML file: 3 ways

The right way depends on whether you want to see the rendered page or the code behind it.

  • In a browser: double-click the file, or drag it into a browser window, to see the rendered page
  • In a text editor: open it with VS Code, Notepad, or any editor to read and modify the source code
  • In the browser as source: press Ctrl+U (Cmd+Option+U on Mac) on any web page to view its HTML

How to view and share an HTML file as a real web page

Opening the file locally works only on your machine. Send a .html file as an email attachment and its CSS, images, and scripts usually break because relative paths no longer resolve.

Publishing the file online solves this. Upload the HTML file — or the whole folder or ZIP with its assets — to HTML To Link (htmlto.link) and you get a normal https link that anyone can open in any browser, on desktop or phone.

FAQ

Is an HTML file the same as a web page?

Not quite. The .html file is the source code; the web page is what the browser renders from it. One file can be a complete page, but full websites usually combine HTML files with CSS, JavaScript, and images.

Can I open an HTML file without a browser?

Yes. Any text editor — from Notepad to VS Code — can open a .html file and show its source code, because HTML is plain text rather than a binary format.

Why does my HTML file look broken when I send it to someone?

Because linked assets like CSS and images are separate files referenced by relative path. Sending only the .html file leaves those references dangling. Publishing the whole folder online keeps every asset in place.

How do I share an HTML file with someone?

The cleanest way is a link, not an attachment. Upload the file or folder to htmlto.link and share the public URL — it opens like any normal web page and keeps the original file structure intact.

Related guides