Manuel B. Garcia

Manuel B. Garcia serves as the Senior Director for Educational Technology and Digital Learning at FEU Institute of Technology, Manila, Philippines. Read More

Contact Info

1607, FEU Tech Building,
P. Paredes St, Sampaloc,
Manila, Philippines
mbgarcia@feutech.edu.ph

Follow Me

AND vs. OR vs. NOT: What Do Boolean Operators Actually Do?

AND, OR, and NOT tell a database how search terms should relate to one another. OR usually combines alternative terms, AND connects different concepts, and NOT excludes results, but small changes in Boolean logic can substantially change what your search retrieves.

51
AND vs. OR vs. NOT Guide 51 of 247
01 · The Question

What Are AND, OR, and NOT Actually Telling a Database to Do?

You have identified your search concepts, collected useful synonyms, and perhaps found appropriate subject headings. Now those terms need to become a search strategy.

This is where three small words become surprisingly consequential: AND, OR, and NOT.

These are Boolean operators. They tell a database how sets of search results should be combined. Using OR where you meant AND can transform the scope of a search. Using AND too aggressively can remove relevant studies. Using NOT may eliminate exactly the article you hoped to find because that article happens to mention the excluded concept somewhere in its searchable record.

The operators themselves are simple. The harder part is understanding what they mean for the records that remain eligible for retrieval.

02 · The Short Answer

AND Narrows, OR Expands, and NOT Excludes

In Brief

AND requires the connected concepts to be represented together, OR allows any of the connected alternatives to qualify, and NOT excludes records that satisfy the term or set placed after it.

In many literature searches, alternative terms for the same concept are combined with OR, while different concepts are combined with AND. NOT should be used much more cautiously because a relevant record can be excluded simply because it also contains the unwanted term.

03 · What You Need to Know

How Boolean Logic Changes the Records Your Search Can Retrieve

Boolean Operators Work With Sets of Records

The easiest way to understand Boolean searching is to stop thinking of AND, OR, and NOT as ordinary English words.

Imagine that every search term produces a set of database records. A search for adolescents produces one set. A search for social media produces another. Boolean operators determine how those sets are combined.

Operator What It Requires Typical Effect
AND Records must satisfy both connected search sets. Usually reduces the number of results.
OR Records may satisfy either or both connected search sets. Usually increases the number of results.
NOT Records satisfying the excluded set are removed from the first set. Usually reduces the number of results, with a risk of excluding relevant records.

This set-based interpretation is more reliable than remembering slogans such as "AND means narrow" and "OR means broad." Those slogans describe the usual numerical effect, but the underlying logic explains why it happens.

AND Means the Concepts Must Meet

Suppose you want research concerning social media among adolescents.

Boolean Logic
"social media" AND adolescents
The first search set represents social media. The second represents adolescents. AND retains records that satisfy both sets.
A record about social media among adolescents can qualify. A record about social media among older adults alone does not satisfy the adolescent set, while a record about adolescent nutrition alone does not satisfy the social-media set.

Because a record now has to satisfy an additional requirement, AND usually makes a search smaller. Cochrane describes AND as combining different concepts so that terms from all included concepts need to be represented for records to be retrieved.

AND is therefore commonly used to connect the major concepts of a research question.

Adding More ANDs Usually Makes the Search More Restrictive

Suppose your question concerns social media, adolescents, and sleep:

Three Concepts
"social media" AND adolescents AND sleep
A record must now satisfy all three concept sets.
Research about adolescents and social media that does not satisfy the sleep set will be excluded, even if it is otherwise highly relevant to the broader topic.

Every additional AND introduces another condition. This can improve precision when the added concept is necessary and reliably represented in searchable records. It can also damage sensitivity when the concept is inconsistently mentioned or indexed.

This is why a search strategy should not automatically contain every element of the research question. Current Cochrane guidance notes that searching every aspect of a review question may be unnecessary or undesirable because some concepts, such as outcomes or comparators, may not be well represented in titles, abstracts, or controlled vocabulary.

OR Means Any of the Alternatives Can Qualify

OR behaves differently. It is usually used to gather alternative ways of representing one concept.

Suppose researchers use both adolescents and teenagers:

Boolean Logic
adolescents OR teenagers
A record can qualify through adolescents, teenagers, or both.
The second term creates another route into the result set rather than another requirement for admission.

OR therefore usually increases retrieval. The database retains the records retrieved by the first term and adds records that can be retrieved through the second term.

This is why synonyms, spelling variants, acronyms, subject headings, and other alternative representations of the same concept are commonly combined with OR.

OR Does Not Mean the Terms Must Be Exact Synonyms

Search terms within an OR group do not need to be dictionary synonyms. They need to be legitimate alternative routes to the concept you intend to retrieve.

For example, one concept may be represented through a preferred subject heading, several free-text synonyms, an acronym, and a spelling variant. Those terms differ linguistically but may all contribute useful access to substantially the same search concept.

The important boundary is conceptual. Adding a broader or neighboring concept with OR does more than increase vocabulary coverage; it changes what can qualify for retrieval.

This is why the work of finding different terms for the same concept must come before mechanically joining everything with OR.

OR Is Particularly Important for Keywords and Subject Headings

Suppose you are searching a biomedical concept using both a MeSH heading and free-text terminology. These are different retrieval routes, but they may represent the same conceptual element of your question.

A simplified structure might look like:

One Concept, Multiple Routes
[subject heading] OR keyword OR synonym OR abbreviation
Each term or search expression provides an alternative way for a record to satisfy the concept.
A record does not need to be found through every representation. Satisfying one route can be enough for that concept block.

This is one reason subject headings and keywords are commonly used together rather than requiring a record to satisfy both routes simultaneously.

AND and OR Usually Work at Different Levels of the Search

A useful literature search often has two levels of logic.

Within a concept, OR gathers alternative terminology. Between concepts, AND requires the different ideas to intersect.

Suppose your research question concerns the relationship between social media use and sleep among adolescents. A simplified strategy could be conceptualized as:

Concept Structure
(social media terms) AND (adolescent terms) AND (sleep terms)
Each parenthetical group represents one concept. Alternative terms within each group would normally be connected with OR.
A qualifying record must satisfy the social-media concept, the adolescent concept, and the sleep concept, but it can satisfy each concept through any appropriate alternative term within that group.

This pattern is widely used in systematic searching. Cochrane's current guidance recommends gathering a broad set of terms for each included concept, combining terms within concepts using OR, and then combining the concept sets using AND.

Think in Concept Blocks Rather Than Long Strings of Words

Once a search contains several concepts and several synonyms, reading it from left to right becomes difficult. Concept blocks make the logic visible.

For example:

Concept A: Online learning "online learning" OR e-learning OR "online education"
Concept B: University students "university students" OR "college students" OR undergraduates
Combine the concepts (Concept A) AND (Concept B)

The first block says that any appropriate expression of online learning can satisfy that concept. The second does the same for the student population. AND then requires a record to satisfy both conceptual blocks.

This way of thinking also makes it easier to diagnose a poor search. If results are too broad or too narrow, you can examine which concept block is responsible rather than randomly adding or deleting terms.

Parentheses Become Important When AND and OR Appear Together

Consider this search:

online learning OR e-learning AND students

What exactly should the database combine first?

Search systems use rules for evaluating Boolean expressions, and those rules can affect the resulting set. Parentheses allow you to state explicitly which terms belong together:

("online learning" OR e-learning) AND students

Now the intention is clear: either expression can satisfy the online-learning concept, and that concept must then intersect with students.

The mechanics of grouping deserve particular attention once searches become more complicated. Understanding how parentheses change a database search prevents the search engine from having to infer a grouping you could have stated explicitly.

NOT Removes an Entire Set of Records

NOT is the operator most likely to be misunderstood.

Suppose you search:

Exclusion Logic
depression NOT adolescents
Begin with the depression result set, then remove records that also satisfy the adolescent search set.
The remaining records are those in the depression set that do not satisfy the adolescent set.

This may sound straightforward, but notice what NOT does not ask. It does not ask whether adolescents are the main topic. It does not ask whether the study population consists exclusively of adolescents. It simply removes records that match the excluded search expression according to the fields and logic used.

NOT Can Remove Relevant Mixed-Population or Comparative Studies

Suppose you want research on depression in adults and decide to exclude adolescents:

depression AND adults NOT adolescents

A highly relevant article comparing depression among adults and adolescents may contain both population terms. Because it satisfies the excluded adolescent condition, NOT may remove it even though it contains the adult evidence you wanted.

This is why Cochrane advises avoiding NOT where possible in systematic searches. The danger is not that the operator malfunctions. It is that it works exactly as instructed while your conceptual intention is more nuanced than the exclusion rule.

Watch Out

NOT does not understand why an excluded term appears in a record. If a relevant article also contains that term, the entire record can disappear from your results. Use exclusion logic only after testing what relevant material it removes.

The risks of exclusion become important enough to warrant their own search decision. Before using NOT to clean up a noisy result set, consider when NOT can accidentally remove relevant research.

Boolean Operators Do Not Understand Meaning

Boolean logic operates on whatever the database considers a match. It does not interpret the scientific relationship among the concepts in the way a human reader would.

If you search teachers AND burnout, the database can identify records satisfying the two search expressions. That does not necessarily mean every retrieved study investigates burnout among teachers. One term might describe the study population while the other appears in background text, a comparison group, an author keyword, or another searchable field.

AND establishes co-retrieval, not necessarily a semantic relationship.

This is one reason field searching and, where supported, proximity searching can become useful. If merely requiring both words somewhere in a record produces too much noise, proximity searching can sometimes express the intended relationship more precisely than AND.

Boolean Logic Works With Whatever Search Fields You Give It

The effect of an operator also depends on where its terms are searched.

A query requiring two terms in titles is much more restrictive than requiring those same terms somewhere across broader searchable fields. Likewise, a subject-heading set combined with a Title/Abstract keyword set is not equivalent to two unrestricted keyword searches.

Boolean operators therefore do not replace decisions about whether terms should be searched in titles, abstracts, keywords, or other fields. They combine the sets those field-specific searches create.

Some Databases Insert AND Automatically

You may already be using Boolean logic without typing an operator.

PubMed, for example, currently applies AND between concepts entered without an explicit Boolean operator. Its documentation gives the example that a search containing vitamin c common cold is translated conceptually as vitamin c AND common cold.

Automatic behavior varies among search systems. Some platforms may interpret spaces differently, offer menu-based Boolean controls, or apply relevance algorithms that make a simple search box behave differently from an advanced database interface.

For a deliberate and reproducible strategy, do not rely on assumptions about invisible operators. Check the documentation of the database and interface you are using.

Boolean Syntax Is Not Identical Across Every Search System

The logical concepts of AND, OR, and NOT are widely used, but syntax and implementation are not perfectly universal.

PubMed instructs users to enter Boolean operators in uppercase. Other databases may have their own conventions, precedence rules, limits, or interfaces for combining search sets. Web search engines may support only parts of traditional Boolean logic or interpret it differently.

This is one reason the same search syntax does not work in every research database. Preserve the conceptual logic when moving between systems, but verify how the destination platform expresses it.

The Number of Results Can Help You Check Whether Your Logic Makes Sense

Result counts are not evidence that a search is correct, but unexpected counts can expose logical errors.

If A retrieves 2,000 records and B retrieves 3,000, then A AND B should not normally produce more than either individual set because the intersection must come from records belonging to both. A OR B should normally be at least as large as either individual set because it contains records from both sets, with duplicates counted only once in the combined result.

If your results behave very differently from what the logic suggests, investigate the query translation, automatic mapping, field restrictions, grouping, or syntax. PubMed's Advanced Search tools, for example, allow searchers to compare result counts and inspect how queries were translated.

Boolean Logic Cannot Tell You Whether Your Concepts Are Well Chosen

A technically correct Boolean expression can still be a poor search.

You can combine the wrong concepts perfectly. You can OR together terms that are not truly alternative representations. You can AND a concept that relevant articles rarely mention. You can exclude a population that appears in mixed-population studies you actually need.

Boolean operators execute your conceptual decisions; they do not validate them.

This is why search development remains iterative. Run the search, inspect relevant and irrelevant results, identify what the logic is doing, and refine it without quietly changing the question the search is supposed to represent.

04 · A Practical Example

How Do AND and OR Turn Search Terms Into a Search Strategy?

Hypothetical Example

Searching for research on online learning among university students

Suppose you want studies about online learning among university students. During terminology development, you identify several expressions for each concept.

Concept 1: Online learning "online learning" OR e-learning OR "online education"
Concept 2: University students "university students" OR "college students" OR undergraduates
Group each concept ("online learning" OR e-learning OR "online education")
("university students" OR "college students" OR undergraduates)
Connect the concepts ("online learning" OR e-learning OR "online education") AND ("university students" OR "college students" OR undergraduates)
Interpret the result A record must satisfy both conceptual groups, but it can satisfy the online-learning group through any included alternative and the student group through any included alternative.

Now suppose the results include many studies of secondary-school students. It may be tempting to append NOT secondary. Before doing so, inspect the unwanted records and test the exclusion. A comparative study involving both university and secondary students could be relevant yet disappear because it contains the excluded term.

A safer first question is whether your positive university-student concept can be represented more effectively. Exclusion should not become a substitute for improving the terms that define what you actually want.

05 · What Researchers Often Get Wrong

Common Boolean Search Mistakes

Misconception

AND Means "Give Me More Results About Both Topics"

AND adds a requirement rather than another retrieval route. A record must satisfy both connected search sets, so adding AND usually reduces the result set. Use it when both concepts need to be represented, not because you want "more" information about them.

Misconception

OR Means the Database Chooses Between My Terms

OR does not select the better term. It allows records retrieved through either alternative to qualify. This is why OR is useful for synonyms, spelling variants, acronyms, subject headings, and other appropriate representations of the same concept.

Misconception

Every Part of My Research Question Should Be Connected With AND

Adding every element can make a search unnecessarily restrictive. Some concepts may be poorly represented in titles, abstracts, or indexing. Current Cochrane guidance explicitly cautions that searching every aspect of a review question may be undesirable in some circumstances.

Misconception

NOT Removes Only Irrelevant Articles

NOT removes records matching the excluded expression, regardless of whether those records are otherwise relevant. A mixed-population or comparative study may disappear simply because it mentions the excluded population.

Misconception

If Two Terms Appear Together, AND Proves They Are Related

AND only requires both search conditions to be satisfied. It does not establish that one concept describes the other or that the relationship you care about is present. When co-occurrence is too loose, field restrictions or proximity searching may provide more appropriate control.

Misconception

The Same Boolean String Will Behave Identically Everywhere

The underlying logic is portable, but database syntax, automatic mapping, operator precedence, fields, and other processing can differ. Translate the strategy for each database rather than assuming that copying the string preserves the search.

06 · What This Means for You

Which Boolean Operator Should You Use?

Do not choose an operator by asking whether you want "more" or "fewer" results. Start with the relationship between the concepts.

A simple decision framework

If two terms are alternative ways of representing the same search concept
They will commonly belong in an OR group so either representation can provide access to a record.
If two concepts must both be represented for a record to address your question
Combine their concept sets with AND.
If you are considering NOT because the results are noisy
First determine why the unwanted records are being retrieved and whether improving the positive search terms would be safer.
If your query contains both AND and OR
Group the intended concept blocks explicitly with parentheses according to the database's syntax.
If AND produces almost no results
Check whether you have required too many concepts or whether one concept is poorly represented in the literature.
If OR produces many irrelevant results
Inspect whether one of the alternatives is ambiguous, overly broad, or conceptually different from the rest of the group.

A useful habit is to build each concept separately before combining the search. Test the terms within one OR group, then test the next concept, and only afterward connect the sets with AND. This makes it much easier to see where unexpected retrieval originates.

For complex searches, keep the Boolean structure visible. If you cannot explain in ordinary language why every OR, AND, and NOT is present, the search probably deserves another inspection before it becomes your final strategy.

07 · A Quick Checklist

Before Running a Complex Boolean Search, Check Its Logic

Before finalizing the search, check:
Identify the distinct concepts in the question before deciding which operators connect them.
Use OR for terms that genuinely provide alternative routes to the same intended search concept.
Use AND when different concept sets must both be represented in the retrieved records.
Avoid adding every element of the research question with AND unless each one is necessary and reliably searchable.
Use parentheses to make concept groups explicit when AND and OR appear in the same query.
Treat NOT cautiously and inspect which records disappear before keeping an exclusion in the final strategy.
Compare result counts after major Boolean changes and investigate results that behave unexpectedly.
Check the database's documentation for operator syntax, automatic processing, and precedence rules.
Test whether known relevant records remain retrievable after the Boolean structure is complete.
08 · Frequently Asked Questions

Frequently Asked Questions About AND, OR, and NOT

What does AND do in a database search?

AND combines search sets by requiring records to satisfy all of the connected conditions. It is commonly used between different concepts and usually reduces the number of results compared with searching either concept alone.

What does OR do in a database search?

OR allows a record to qualify through any of the connected alternatives. It is commonly used for synonyms, spelling variants, acronyms, subject headings, and other appropriate representations of one concept, and it usually increases retrieval.

What does NOT do in a database search?

NOT removes records that satisfy the excluded search expression from the preceding result set. Because relevant records can contain the excluded term too, NOT should be used cautiously and tested before becoming part of a consequential search.

Should synonyms be connected with AND or OR?

Alternative terms representing the same search concept are commonly connected with OR. Connecting them with AND would require records to satisfy both expressions and could exclude relevant literature that uses only one.

Should different concepts be connected with AND or OR?

If the research question requires both concepts to be represented, their search sets are commonly connected with AND. Do not automatically AND every element of the question, however, because some concepts may be poorly searchable and unnecessarily reduce sensitivity.

Does AND always reduce the number of results?

Conceptually, intersecting a set with another condition cannot add records that were not already in the first set. In practice, database-specific query processing, automatic mapping, syntax, or comparing non-equivalent searches can make result counts appear less intuitive. Inspect the actual query translation when something unexpected occurs.

Do I need to type AND between words in PubMed?

Not always. Current PubMed documentation states that AND is applied between concepts when an explicit Boolean operator is absent. For complex and reproducible searches, however, writing the intended Boolean structure explicitly can make the logic clearer, particularly when AND and OR are combined.

Do Boolean operators need to be uppercase?

That depends on the search platform. PubMed explicitly instructs users to enter AND, OR, and NOT in uppercase. Other databases may have different requirements or interfaces, so verify the syntax rather than assuming one convention applies everywhere.

09 · The Bottom Line

Boolean Operators Express the Logic of Your Search

The Bottom Line

Use OR to provide alternative routes to the same search concept, AND to require different concepts to occur in the same result set, and NOT only when you have good reason to exclude an entire set of records and have checked what relevant material may disappear with it.

The operators are simple, but the decisions behind them are not. Build searches around concepts, group alternatives explicitly, test each major change, and remember that Boolean logic faithfully executes the search you wrote, not necessarily the research question you intended.

10 · Sources and Further Reading

Authoritative Resources on Boolean Searching

11 · Cite this Guide

How to Cite This Guide

This guide is intended to be read, shared, and used in research, teaching, and academic work. If you draw on its ideas, explanations, or other content, please acknowledge the source by citing the guide. Doing so gives appropriate credit and helps your readers locate the original resource.

Has the Field Guide helped your research?

If a guide helped clarify a question, inform a research decision, or move your work forward, I would love to hear about your experience. Your story may also help other researchers discover the Field Guide.

Share Your Experience
Takes only a few minutes