How to check if a website is online

Ever wonder how to check if a website is still working, without having to load up the website and manually check every few minutes? In this article, we'll go over the various ways to check if a website is online.

If you just want a tool to check if a website is down, check out OnlineOrNot's website down checker.

Table of contents:

Why do websites go offline?

In its simplest form, a website is a collection of files that are hosted on a server. When you visit a website, your browser makes a request to the server, and the server responds with the files for the website. More recently, websites have started to use APIs to fetch data to generate webpages from other servers, but the core concept is the same.

When we say a website is online, we mean that a server is responding (with the expected files) to requests from the Internet.

Things aren't that simple when a website is offline, though. There are a few different ways a website can be offline:

1. The server is down

If the server is down (that is, not running), it can't respond to requests from the Internet, so the website will be unavailable.

2. The server takes too long to respond

If the server takes too long to respond, the browser will give up and show an error. This often happens when a server is overloaded with requests, or if the server makes a request to another server, which itself is overloaded.

Smaller companies tend to run into this issue by hosting their websites on small servers without a CDN in front, as the servers often don't have enough RAM/CPU to handle the number of requests they receive.

In my experience, this is the most common way a website can be offline.

3. The domain name is not pointing to the server

If the domain name is not pointing to the server, the server won't receive any requests from the Internet.

You might run into this issue when launching your website, as in the worst case, it can take a few hours for the domain name to start pointing to the server. This can also happen when changing domain name registrars.

4. The domain name has expired

If the domain name has expired, the domain name registrar will stop pointing the domain name to the server. This is an avoidable problem however, and I wrote about how to avoid losing your domain name a while back.

5. The SSL certificate has expired

This tends to happen a lot less these days with the advent of automatically renewing SSL certificates from LetsEncrypt and free SSL certificates from the likes of Cloudflare, but SSL certificates do have an expiry date.

If your server isn't configured to automatically renew its SSL certificate, modern browsers often won't even try to display your website, and users are trained to avoid sites that don't use HTTPS.

How to check if a website is online

There are a few ways to check if a website is online, some requiring more manual work than others:

1. Visit the website

The most obvious way to check if a website is online is to visit it using your browser. If you can see the website, it's online. If you can't, it's probably offline (assuming your internet connection is fine).

This method isn't bulletproof, as a website appearing online for you doesn't guarantee that it's online for everyone else.

2. Use a command line tool

If you're technically-minded, you can use a command line tool like curl in your Terminal to check if a website is online.

curl https://www.google.com

If you see a bunch of HTML, the website is online. If you see an error, the website is offline.

If you want to take it further, you can turn the above command into a script that runs every few minutes, and sends you an email if the website is offline:

#!/bin/bash
if curl -s https://www.google.com | grep -q "html"; then
echo "Website is online"
else
echo "Website is offline" | <command to send email goes here>
fi

3. Use an online tool

OnlineOrNot's website down checker is a free tool to check if a website is online.

All you need to do is enter a URL, such as https://www.google.com, and click "Check".

OnlineOrNot will then check the website from the US East Coast, US West Coast, Australia, Europe, and Asia Pacific regions to see if the website is online, and how long it takes to respond:

OnlineOrNot website down checker

4. Monitor your website

If you're running a business, you probably don't have time to check if your website is online every few minutes. You also don't want to have customers email/call/text you frantically that your website is down, and they're unable to use your product.

This is where website uptime monitoring services like OnlineOrNot come in. It checks if your website is online up to every 30 seconds, and if it's not, you'll immediately get a notification via email, SMS, Slack, or Discord.

How to monitor your website

To monitor a website with OnlineOrNot, all you need is the URL.

I tend to give my checks memorable names, so I can easily tell what they're for, and I set the check to run from around the world, so I can be sure the website is online for everyone:

OnlineOrNot landing page monitoring settings

After adding the check, you will start to see the results in the dashboard:

OnlineOrNot dashboard

How to monitor keywords on a website

Monitoring for keywords on OnlineOrNot requires one extra step.

In a check's advanced settings I set the 'Text to search for' to look for the keyword I'm interested in (it also supports HTML, if you want to check for a specific HTML element):

OnlineOrNot landing page monitoring settings

Once setup, OnlineOrNot will send you an alert whenever that keyword is not found on the website.

Get started

Start monitoring your website, API endpoints, and cron jobs
with OnlineOrNot today.