Heuristic

A heuristic is a "rule of thumb," or a practical shortcut for making decisions. In computer science, a heuristic is a technique an algorithm uses to find a "good enough" solution when the perfect one would take too long to compute.

Some real-world problems have so many possible solutions that checking every one is impractical, even for the fastest computers. A heuristic narrows the search by focusing on a reduced set of possible options, generated by a set of guidelines.

For example, shipping software needs to figure out how to pack items of different sizes into as few shipping boxes as possible. Instead of checking every possible combination, a simple heuristic like "pack the largest items first, then fill the gaps with smaller ones" produces a helpful result almost instantly. Online retailers like Amazon.com rely on heuristics like this every day.

Common uses of heuristics

  • Pathfinding algorithms determine which paths to explore first. Video games and mapping apps use this to find routes quickly.
  • Antivirus software uses heuristic analysis to spots malware by looking for suspicious behavior, such as a program trying to change system files or encrypt many documents.
  • Video game AI, such as chess engines, can't analyze every possible move, so they use heuristics to judge which positions look strong.
  • Compilers use heuristics to decide how to optimize code during compilation, such as when to inline a function.
  • User interface designers often evaluate software using "usability heuristics," such as keeping the user interface consistent and providing clear feedback.
Some techniques, called metaheuristics (such as genetic algorithms), provide general strategies for searching huge sets of possible solutions.

In computing, heuristics may trade some accuracy or certainty for speed. When an exact answer is too expensive to compute (in time or tokens), a good heuristic can produce a useful result in a reasonable amount of time.

Updated November 18, 2026 by Per C.

quizTest Your Knowledge

What technology allows users to analyze data from multiple database systems at one time?

A
DHCP
0%
B
OLAP
0%
C
RTMP
0%
D
PPTP
0%
Correct! Incorrect!     View the OLAP definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Heuristic on this page is an original definition written by the authors of TechTerms.com. If you would like to reference this page or cite this definition, please use the green citation bar directly below the definition.

Our goal is to explain computer terminology in a way that is easy to understand. We strive for accuracy and simplicity with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

The Tech Terms Newsletter

Improve your technical knowledge with our daily or weekly newsletter! Subscribe today and get new terms and quizzes delivered to your inbox.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email. Questions? Please contact us.