Tool for creating and using a Karnaugh map to simplify Boolean functions, reduce logical expressions from an expression or truth table.
Karnaugh Map - dCode
Tag(s) : Symbolic Computation, Electronics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
A Karnaugh map (or Karnaugh map) is a graphical tool used in Boolean algebra to simplify logical expressions, called Boolean functions.
It allows you to go from a canonical form (sum of products or product of sums) to a simpler equivalent expression by visually grouping adjacent cells.
The goal is to reduce the number of variables in each term, and therefore decrease the number of logic gates needed to implement a digital circuit, thus optimizing its complexity, reliability, and cost.
Determine the number of variables: a Karnaugh map has $ 2^n $ cells for $ n $ Boolean variables.
Organize the rows and columns: label the rows and columns with the binary combinations of the variables, arranged in Gray's order (only one bit changes between two adjacent cells). This ordering ensures that two neighboring cells differ by only one variable, an essential condition for simplification.
Example: For 4 variables (A, B, C, D): $$ \begin{array}{c|c|c|c} \hline _{AB} \backslash ^{CD} & 00 & 01 & 11 & 10 \\ \hline 00 & & & & \\ 01 & & & & \\ 11 & & & & \\ 10 & & & & \\ \hline \end{array} $$
Fill the cells by placing the $ 1 $ and $ 0 $ values in each corresponding cell.
— Number of variables: Karnaugh maps are particularly well-suited for up to 4 variables (16 cells). With 5 or 6 variables, the method remains possible but quickly becomes difficult to read and use correctly. Beyond that, algorithmic methods like Quine-McCluskey or software tools are preferable.
— Subjectivity of groupings: Several valid groupings may exist for the same function, leading to different but logically equivalent expressions.
The Karnaugh map was developed in 1953 by Maurice Karnaugh, an American engineer working at Bell Labs.
It is based on Veitch diagrams, introduced in 1952, but improves upon them by systematically using Gray's order.
This innovation makes adjacencies more visible and greatly simplifies the grouping of terms, which has contributed to its widespread adoption in digital electronics and computer science.
dCode retains ownership of the "Karnaugh Map" source code. Any algorithm for the "Karnaugh Map" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Karnaugh Map" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Karnaugh Map" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Karnaugh Map" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Karnaugh Map on dCode.fr [online website], retrieved on 2026-01-08,