# Karnaugh Map (K-Map) Solver API

> For the complete documentation index, see [llms.txt](/llms.txt).

Minimise 2-5 variable boolean functions from minterms, maxterms, or a truth table with Quine-McCluskey, returning prime implicants and the Gray-coded K-map grid.

Use this endpoint to add the tool to your app, site, workflow, or agent without rebuilding formulas, validation, examples, and docs.

- Slug: `karnaugh-map-k-map-solver`
- Category: `math`
- Version: `2026-04-22`
- Credits per successful call: 1
- Starts on: free
- Max payload: 65536 bytes
- Privacy mode: `hash_only`
- Available on: free, starter, pro, business, scale
- Browser tool: https://miniwebtool.com/karnaugh-map-k-map-solver/

## Endpoint

`POST https://api.miniwebtool.com/v1/tools/karnaugh-map-k-map-solver/run`

## Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `nvars` | `int` | no | number of variables, 2-5 |
| `input_mode` | `str` | no | minterms | maxterms | truthtable Choices: minterms, maxterms, truthtable |
| `minterms` | `str` | no | comma-separated minterm indices |
| `maxterms` | `str` | no | comma-separated maxterm indices, for input_mode=maxterms |
| `dontcares` | `str` | no | comma-separated don't-care indices |
| `truth_table` | `str` | no | output column as 0/1/x values, for input_mode=truthtable |
| `form_type` | `str` | no | SOP | POS Choices: SOP, POS |

## Example request

```json
{
  "nvars": 4,
  "input_mode": "minterms",
  "minterms": "0, 1, 2, 5, 6, 7, 8, 9, 10, 14",
  "form_type": "SOP"
}
```

## cURL

```bash
curl -X POST https://api.miniwebtool.com/v1/tools/karnaugh-map-k-map-solver/run \
  -H 'Authorization: Bearer mwt_live_YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"nvars":4,"input_mode":"minterms","minterms":"0, 1, 2, 5, 6, 7, 8, 9, 10, 14","form_type":"SOP"}'
```

## Response envelope

```json
{
  "request_id": "01K...",
  "tool": "karnaugh-map-k-map-solver",
  "tool_version": "2026-04-22",
  "credits_used": 1,
  "result": {}
}
```

## Errors

Errors are RFC 7807 `application/problem+json`. Branch on `code`, not `title`.

## MCP

Agents can discover and call this tool through `https://api.miniwebtool.com/mcp` or `https://api.miniwebtool.com/v1/mcp` using MCP `tools/list` and `tools/call`.

## Frequently asked

### What does the Karnaugh Map (K-Map) Solver API do?

Minimise 2-5 variable boolean functions from minterms, maxterms, or a truth table with Quine-McCluskey, returning prime implicants and the Gray-coded K-map grid. Use it to add this utility without rebuilding formulas, validation, examples, and documentation.

### How much does one call cost?

1 credit per successful call. Failed calls do not bill.

### What parameters are required?

Required fields: (none). Full schema at `https://api.miniwebtool.com/v1/openapi.json`.

### Is this deterministic?

Yes. Same input, same output. Tool version: 2026-04-22.
