Boolean operators are a versatile and valuable tool for anyone using search engines to look for in­form­a­tion online. They are math­em­at­ic­al operators used with a special syntax and can be used to expand or restrict search op­er­a­tions or pro­gram­ming sequences, or to apply certain con­di­tions. This guide lists the most useful Boolean operators, with examples to show how they can be used.

Cheap domain names – buy yours now
  • Free website pro­tec­tion with SSL Wildcard included
  • Free private re­gis­tra­tion for greater privacy
  • Free Domain Connect for easy DNS setup

Helpful Boolean operators for Google searches

Operator Function
AND Links con­di­tions together; the results must match all the specified words/phrases
OR Links con­di­tions together; the results must match one of the specified words or phrases
NOT Excludes terms from the search results
AROUND(X): A proximity condition; finds terms within X words of each other
IN: Performs quick con­ver­sions between different units/cur­ren­cies, etc.
define: Returns a defin­i­tion of the specified search term
weather: Displays a detailed weather forecast for the desired des­tin­a­tion

What are Boolean operators?

The three basic ex­pres­sions of Boolean algebra, as es­tab­lished by English math­em­atician George Boole, are AND, OR, and NOT. These operators are used in all common pro­gram­ming languages, primarily to return results based on whether specified con­di­tions are ‘true’ or ‘false’.

Defin­i­tion

Boolean operators are used to write logical ex­pres­sions that test whether a specified condition is ‘true’ or ‘false’. They specify and/or link together certain con­di­tions.

The operators can be expressed in symbols as well as in words. These symbols are also known as ‘logical operators’ and are mainly used in pro­gram­ming languages. For example:

  • & or && mean AND
  • | or || mean OR
  • ! or ~ mean NOT

Placing the AND operator between two con­di­tions means that both con­di­tions must be met in order for the result to be ‘true’.

With the OR operator, only one condition has to be met for the result to be ‘true’.

When NOT is used, all the con­di­tions except the excluded ones must be true.

Search engines like Google use these Boolean operators as follows:

  • AND: A space between two terms is in­ter­preted as ‘AND’.
  • OR: Both the word ‘OR’ and the pipe symbol ( | ) act as the OR operator. The Windows keyboard shortcut for the pipe symbol is ALT + [0] [1] [2] [4] (on the number pad). In MacOS it is [ALT] + [7].
  • NOT: Putting a minus sign before a word (with no space) excludes the word from the search. Be careful not to ac­ci­dent­ally type a dash instead of the minus sign, as this will give com­pletely different search results.
Tip

For an overview of fre­quently used Boolean operators for Google Searches, check out our guide: ‘Advanced web search with Google operators’.

Special Boolean operators

Some extra Boolean operators have been added to the basic ones described above to make searching even more efficient.

Tip

Use a notes app to save your favourite search queries on your desktop. This will save you a lot of time, whether it’s looking up the operators, or typing the queries!

AROUND(X): Cut through the noise

One of the lesser-known Boolean operators is AROUND(X), which can be used when searching for multiple terms. The X is a number that specifies how far ‘around’ the first term the second must be found. It defines the maximum permitted distance, in words, between the two terms.

Here’s an example to il­lus­trate how it works:

Car AROUND(2) Berlin-Mitte

This Boolean search tells Google to look for the terms ‘car’ and ‘Berlin-Mitte’ with two (or fewer) words between them. As you can see, the results differ from those obtained by simply searching ‘Car Berlin-Mitte’.

IN: Quick con­ver­sions of meas­ure­ments and cur­ren­cies

The Boolean operator IN is a con­veni­ent way of con­vert­ing units of meas­ure­ment or cur­ren­cies. Simply enter the amount or meas­ure­ment with its unit or currency, followed by ‘IN’, and the output unit or currency. For example, if you enter ‘87 cm IN inches’, Google returns the result ‘34.252 inches’, with a note in­dic­at­ing the math­em­at­ic­al formula used to do the cal­cu­la­tion. For cur­ren­cies, the exchange rate (and a dis­claim­er) is shown.

This operator works with other common units of meas­ure­ment like tem­per­at­ures (Celsius/Fahren­heit), lengths, surface areas, and volumes, but not with rare units. For instance, if you try to convert degrees Celsius to the Réaumur tem­per­at­ure scale, which is no longer in use, Google will only return the Wikipedia entry and various con­ver­sion sites.

source: Specify the source of a news item

When people hear the word ‘source’ in a computer context they often think of the source code of a website. Here, though, ‘source’ is used in the journ­al­ist­ic sense to find results from one of the news sources listed in Google News. For instance, suppose you wanted to find articles about a collapsed building in Florida, written by CNN. You would enter:

Collapsed building Florida source:CNN

weather: Suncream or umbrella?

If you type ‘weather:’ followed by a place name, Google will display a graphical weather forecast for the week ahead, including tem­per­at­ure, pre­cip­it­a­tion, and wind. The source of the data is the weather.com website. Below the forecast you will also see results from various weather websites.

weather:Berlin

Other advanced operators

Here are some other handy Boolean operators for Google searches:

Enter ‘define:’ followed by a term to get its defin­i­tion, an audio button to hear how the term is pro­nounced, and notes about spelling, synonyms, etc.

define:birdbath

To search various sources for results relating to a par­tic­u­lar movie, you can use the ‘movie:’ operator. For example, let’s say you’re in­ter­ested in movies about the Second World War, filmed or set in Berlin. You could search for:

movie:Berlin 1945

The searched sources include YouTube (part of Google), online en­cyc­lo­pe­di­as as well as state-owned and private archives. If the movie is currently showing at cinemas in your area, Google will also display showtimes and venues.

Combining Boolean operators

Another great thing about Boolean operators is that you can combine them to make your searches even smarter. We’ve listed some useful com­bin­a­tions below.

Improve the SEO of your website

The following search query can be used to find pos­sib­il­it­ies for internal links:

site:website.tld [keyword]

This helps users navigate your website and increases your chances of being linked to from other websites.

Find content on a specific website

Example:

site:website.tld ‘photography’

This search will return all (sub)pages from the specified website that contain the word ‘pho­to­graphy’. And in the Google Images tab you will see photos found on the specified website.

Tidy up forgotten files

The trick to finding ‘forgotten’ files on your own website is to combine the ‘site:’ and ‘filetype:’ operators, as shown below:

site:website.tld filetype:pdf

or

site:website.tld filetype:pdf keyword

The first of these queries will show all PDF files from the specified website. You can refine the results by adding a keyword, as shown in the second query. As explained above, the spaces are equi­val­ent to the ‘AND’ operator. The filetype operator currently works with around 25 common file types, including documents, images, and videos.

Identify pages without HTTPS

As a webmaster, you may want to check your website for unsecure pages, which are those without HTTPS. To do this, you can use the following query:

site:website.tld -inurl:https

The minus sign here excludes pages with https in their URL. The remaining indexed pages are therefore not encrypted with HTTPS.

Grouped search queries

You can use round brackets to group parts of a query together. For instance:

tire balancing (Berlin-Spandau OR Falkensee OR Staaken) -sales

Do not put more than five keywords in the brackets, otherwise the search may fail. Note that -sales here excludes pages with that keyword, so that only workshops are displayed.

rank­ing­Coach
Boost sales with AI-powered online marketing
  • Improve your Google ranking without paying an agency
  • Reply to reviews and generate social media posts faster
  • No SEO or online marketing skills needed

Search ‘from…to’ using numrange

The shorthand for the ‘numrange’ operator is two little dots: ‘..’. The numbers in question can be numerical postcodes, years, or meas­ure­ments. The query below combines the ‘intitle:’, ‘OR’ and ‘..’ operators, and returns results for SEO copy­writers in the Manchester area:

intitle:job OR vacancy ‘SEO copywriter’ M1 1AD..M1 3AQ Manchester

If no results are found, Google will display sug­ges­tions from the sur­round­ing area.

Note

When using numrange with numerical postcodes, it’s best to enter the city too, so that Google knows that you’re looking for a location.

You can use the numrange operator to find pages indexed between two dates too. However, Google uses the Julian calendar, so you’ll need to convert the dates to this format first. Al­tern­at­ively, to avoid the need for con­ver­sion, you can just use the years, for example, ‘2009..2014’.

Find favourite topics

Example:

site:*.co.uk intitle:tips cycling beginners

At the time of writing, the search query above finds 6,090 .co.uk webpages that have the terms ‘tips’, ‘cycling’, and ‘beginners’, in the page title. The asterisk ( * ) acts as a wildcard, letting you search for any website with the specified domain name extension.

Let’s see what happens if we edit the code as follows:

site:*.co.uk intext:tips cycling beginners

This returns 398,000 results, because Google is now looking for the keywords in the page text, not just in the title. This shows that pages with keywords in the title stand out better.

Tip

The Boolean searches il­lus­trated here for Google can in principle be used in other search engines too, as they are all based on Boolean operators. For an overview of search engines, take a look at our article on Google al­tern­at­ives.

Go to Main Menu