HTTPS is HTTP sent inside an encrypted TLS connection, and HTTP is the same protocol sent as plain text. With HTTPS, nobody between you and the server can read or change the pages, passwords and cookies you exchange, and the server has to prove with a certificate that it really is the site named in the address bar.
The requests and responses themselves are identical. GET /login is still GET /login; HTTPS only changes how those bytes travel.
HTTP vs HTTPS at a glance
| HTTP | HTTPS | |
|---|---|---|
| URL starts with | http:// | https:// |
| Default port | TCP 80 | TCP 443 |
| Content encrypted in transit | No | Yes (TLS) |
| Server proves its identity | No | Yes, with a certificate for that hostname |
| Tampering by the network | Undetectable | Detected; the connection fails |
| Restricted browser features (service workers and others) | Not available | Available |
The ports come from RFC 9110: an http URL without a port means TCP 80, and an https URL means TCP 443. The same RFC defines "secured" for HTTPS as meaning "the server has been authenticated as acting on behalf of the identified authority": the encryption comes with proof of who is on the other end.
RFC 9110 also says resources on https "have no shared identity" with http. To a browser, http://example.com and https://example.com are different origins, so they get separate localStorage and are treated as cross-origin by CORS and the same-origin policy.
What HTTPS hides, and what it doesn't
People often assume HTTPS makes browsing invisible. It doesn't, and the split is worth knowing:
| Visible to your Wi-Fi, ISP or employer network | Hidden by HTTPS |
|---|---|
| The server's IP address | The full URL path and query string (/search?q=...) |
| The hostname, through DNS lookups | Page content |
| The hostname in the TLS handshake (Server Name Indication), unless Encrypted Client Hello is used | Form data, passwords, cookies |
| When you connect and roughly how much data moves | Request and response headers |
The hostname leak is a known gap. RFC 9849, which defines TLS Encrypted Client Hello (ECH), calls the plaintext SNI field "perhaps the most sensitive information left unencrypted in TLS 1.3." ECH encrypts it, but both the browser and the site have to support it. DNS lookups are a separate leak that DNS over HTTPS addresses.
See the HTTP to HTTPS redirect yourself
Most sites still answer on port 80, but only to send you to the HTTPS version. You can watch this with curl -I, which prints just the response headers:
curl -sI http://en.wikipedia.org/
Output (October 2026, trimmed):
HTTP/1.1 301 Moved Permanently
content-length: 0
location: https://en.wikipedia.org/
The 301 status and location header send the browser to https://. The weak spot is that first request: it travels in plain text, so an attacker on the same network could answer it with something else before the redirect arrives.
HSTS: how sites stop the first request being HTTP
The fix for that weak spot is the Strict-Transport-Security (HSTS) response header. Ask for the HTTPS page and look for it:
curl -sI https://en.wikipedia.org/wiki/Main_Page | grep -i strict-transport
Output:
strict-transport-security: max-age=106384710; includeSubDomains; preload
max-ageis how long, in seconds, the browser must use only HTTPS for this host. 106,384,710 seconds is about 3.4 years.includeSubDomainsapplies the rule to every subdomain too.preloadasks to be built into browsers' preload lists, so even the very first visit skips HTTP. MDN notes this requiresmax-ageof at least 31536000 (1 year) andincludeSubDomains.
Browsers ignore the header if it arrives over plain HTTP, so an attacker can't inject or shorten it. Once a browser has seen it, typing http:// for that site is upgraded locally before anything leaves your machine.
Mixed content: HTTPS pages loading HTTP resources
A page served over HTTPS that pulls in scripts, images or styles over http:// has mixed content, and those resources travel unprotected. MDN describes what current browsers do:
- Images, audio and video loaded with
srcare automatically upgraded tohttps://. - Everything else is blocked, including
<script src>, stylesheets, iframes, fonts, andfetch()or XMLHttpRequest calls. - Requests to a bare IP address over HTTP are blocked rather than upgraded.
If part of your site breaks after moving to HTTPS, the browser console lists each blocked URL. Change them to https:// (or to relative paths), or send the CSP directive upgrade-insecure-requests while you clean up.
What the padlock does not promise
HTTPS proves you're connected to the domain in the address bar and that nobody in between can read or change the traffic. It doesn't vouch for the people who run that domain. The FTC puts it plainly: scammers can use encryption too, and data you send to a fraudulent site "won't be safe from scammers operating the site." Check the domain name, especially on login pages reached from email links.
How a certificate gets its trust is covered in what a certificate authority is, and the connection setup itself in the TLS handshake explained.
Is there any reason to use plain HTTP?
For a public website, no. HTTPS is required for service workers and many other web APIs that MDN describes as available only in secure contexts. Plain HTTP survives mainly on local development servers (browsers treat http://localhost and 127.0.0.1 as secure contexts), on devices inside a private network, and as the port-80 listener whose only job is the redirect shown above.
Frequently asked questions
- Is HTTPS slower than HTTP?
- The TLS handshake adds setup work before the first request: one extra round trip with TLS 1.3. After that, encryption costs little on modern hardware, and browsers only offer some newer features, such as service workers, on secure pages. For almost every site the difference is not something a visitor notices.
- Does HTTPS mean a website is safe?
- No. HTTPS means the connection is encrypted and the server proved it controls the domain name in the address bar. It says nothing about whether the people running that domain are honest. Phishing sites routinely use HTTPS, so check the domain name itself, not just the padlock.
- Can my employer or ISP see HTTPS sites I visit?
- They can see which sites you connect to, through DNS lookups, the server's IP address and, unless Encrypted Client Hello is used, the hostname sent at the start of the TLS handshake. They cannot see the page path, search terms, form data or cookies. A work device with a company-installed root certificate is the exception: that lets the company inspect HTTPS traffic.
- Why does a site still load over HTTP sometimes?
- If you type a bare domain, the browser may try http:// first, and the site then redirects to https://. Sites that send a Strict-Transport-Security header, or are on browsers' HSTS preload list, skip that first insecure request on later visits.