This prompt is designed for document automation engineers who need to programmatically determine the state of every checkbox on a form after the checkbox regions have already been identified. It is a state classifier, not a detector. The ideal user has an upstream process—such as a PDF parser extracting form field widgets, a heuristic algorithm identifying square regions, or a separate object-detection model—that provides precise bounding box coordinates or pre-cropped images of individual checkboxes. The job-to-be-done is reliably classifying each provided region as checked, unchecked, or indeterminate to automate data entry, form completeness audits, or compliance reviews.
Prompt
Checkbox Detection Prompt Template

When to Use This Prompt
Defines the ideal use case, required inputs, and critical limitations for the checkbox state classification prompt.
Use this prompt when your pipeline already produces clean, isolated checkbox crops or exact coordinates and you need a high-accuracy classification step. It is particularly effective for processing scanned forms where visual noise, fax artifacts, or handwritten marks make rule-based pixel-counting approaches unreliable. The prompt expects you to supply either a list of cropped checkbox images or a full page image paired with an array of bounding box coordinates. It returns a structured JSON array where each entry includes the original region identifier, the classified state, and a confidence score. This output can be directly ingested by downstream validation logic or a human review queue.
Do not use this prompt for free-form checkbox discovery on a full page without pre-cropping or coordinate inputs. It is not designed to locate checkboxes; that task requires an object-detection model, a region-proposal prompt, or a deterministic PDF form parser. Using this prompt for discovery will produce unreliable results and hallucinated bounding boxes. Additionally, avoid this prompt for real-time video streams, multi-page documents where checkbox regions span page breaks without coordinate normalization, or forms where the visual distinction between a printed box border and a checkmark requires sub-pixel analysis beyond typical vision model capabilities. For those scenarios, combine this prompt with a dedicated detection step and coordinate normalization logic.
Use Case Fit
Where the Checkbox Detection Prompt Template delivers reliable results and where it introduces unacceptable risk. Use these cards to decide if this prompt fits your document pipeline before you invest in integration.
Good Fit: High-Volume Standardized Forms
Use when: processing thousands of identical or near-identical forms (tax documents, intake questionnaires, compliance checklists) where checkbox positions are predictable and the primary variation is checked vs. unchecked state. Guardrail: batch-process with a confidence threshold of at least 0.85 and route low-confidence detections to a human review queue before downstream decisions consume the output.
Bad Fit: Hand-Drawn or Irregular Checkboxes
Avoid when: forms contain hand-drawn boxes, circles used as checkmarks, or non-standard indicators where the user's intent is expressed through idiosyncratic marks rather than filling a printed box. Risk: the model will produce high-confidence false negatives on valid selections or misclassify decorative marks as checked boxes. Guardrail: pre-filter documents with a layout classifier and route irregular forms to a manual annotation workflow instead.
Required Inputs: High-Resolution Rasterized Pages
Use when: you can provide 300 DPI or higher page images with consistent lighting and minimal skew. The prompt requires per-page image input plus an optional field map describing expected checkbox regions. Avoid when: input is low-resolution fax scans, heavily compressed JPEGs, or vector PDFs where the model must hallucinate pixel boundaries. Guardrail: add a pre-processing step that rejects pages below 200 DPI effective resolution and returns an explicit 'input quality insufficient' error before the prompt runs.
Operational Risk: False Positives on Printed Box Borders
Risk: the model confuses thick printed box borders, decorative frames, or adjacent table cell boundaries with filled checkboxes, especially in low-contrast scans or documents with heavy ink bleed. Guardrail: implement a post-detection validator that compares the detected fill ratio against the bounding box area. Regions with fill concentrated only on edges rather than the interior should be flagged for review or reclassified as unchecked.
Operational Risk: Checkmark Bleed into Adjacent Fields
Risk: a large or sloppy checkmark extends beyond its intended box into a neighboring checkbox region, causing the model to report both as checked when only one was selected. Guardrail: add spatial overlap analysis in post-processing. When two adjacent checkboxes both return 'checked' with overlapping confidence regions, flag both for human review and include the original crop in the review payload.
Operational Risk: Indeterminate State Misclassification
Risk: partially filled checkboxes, erased marks, or boxes with stray pen dots are classified as either checked or unchecked rather than the correct indeterminate state, causing downstream logic to make binary decisions on ambiguous input. Guardrail: calibrate a three-way classification threshold using a labeled calibration set. Any detection with confidence below 0.75 for both checked and unchecked should default to indeterminate and trigger human review.
Copy-Ready Prompt Template
A reusable prompt for classifying checkbox states in documents, with placeholders for input data, output schema, and operational constraints.
This prompt template is the core instruction set for a checkbox detection workflow. It is designed to be sent to a multimodal large language model alongside a page image or a structured representation of the document. The prompt instructs the model to identify every checkbox on a page, classify its state, and return the results in a strict JSON schema. Before integrating this prompt into your pipeline, you must replace each square-bracket placeholder with the specific data, rules, and format requirements for your use case.
textYou are a document layout analyst specialized in form field detection. Your task is to analyze the provided document page and identify every checkbox present. A checkbox is a small square or rectangular region, typically empty or containing a mark (check, cross, fill, dot), intended for binary or multi-option selection. For each checkbox you find, you must determine its state and provide precise spatial coordinates. Use the following definitions: - **checked**: The box contains a clear intentional mark (checkmark, cross, solid fill, or 'X') that fills or crosses the interior. - **unchecked**: The box is visually empty or contains only pre-printed guide marks (e.g., faint dots, background patterns). - **indeterminate**: The box contains a partial, ambiguous, or erased mark where a definitive state cannot be assigned with high confidence. [INPUT] [CONSTRAINTS] You must return your findings as a single JSON object conforming to the following schema. Do not include any text outside the JSON object. [OUTPUT_SCHEMA] Before finalizing your output, double-check your work against these rules: - Do not classify printed box borders or decorative elements as checkboxes. - A checkmark that clearly extends into an adjacent field should be flagged with a low confidence score for that adjacent field. - If the scan quality is low, increase the confidence threshold for the 'checked' state to avoid false positives.
To adapt this template, replace [INPUT] with a clear description of the data being passed, such as a base64-encoded image or a reference to a page in an S3 bucket. Replace [CONSTRAINTS] with operational rules, like ignoring specific page areas or handling known form artifacts. The [OUTPUT_SCHEMA] placeholder must be replaced with your exact JSON schema, including fields for checkbox_id, state, bounding_box (with x, y, width, height normalized to 0-1000), and confidence (a float from 0.0 to 1.0). For high-stakes automation, add a final instruction to output a review_required boolean if any state is indeterminate or confidence is below a defined threshold, ensuring a human-in-the-loop checkpoint.
Prompt Variables
Required and optional inputs for the Checkbox Detection Prompt Template. Each placeholder must be populated before the prompt is sent to the model. Validation notes describe how to verify the input is well-formed before execution.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[DOCUMENT_IMAGE] | Base64-encoded image or URL of the form page containing checkboxes to classify | data:image/png;base64,iVBORw0KGgo... or https://storage.example.com/form-page-3.png | Validate MIME type is image/png, image/jpeg, or image/tiff. Reject if payload exceeds 20MB. Verify image dimensions are at least 300x300px to avoid thumbnail artifacts. |
[PAGE_NUMBER] | Integer indicating which page of a multi-page document this image represents | 3 | Must be a positive integer. Used for coordinate offset calculation in multi-page forms. Null allowed for single-page documents. |
[CHECKBOX_REGIONS] | Array of bounding box coordinates defining candidate checkbox areas to inspect | [{"id":"cb_12","bbox":[120,340,145,365],"label_hint":"I agree to terms"}] | Each region must have id, bbox with 4 integers [x1,y1,x2,y2], and optional label_hint. Validate bbox coordinates are within image dimensions. Empty array triggers full-page detection mode. |
[CONFIDENCE_THRESHOLD] | Float between 0.0 and 1.0 setting the minimum confidence for a classification to be accepted without human review flag | 0.85 | Must be a float. Values below 0.7 increase false positives on printed borders. Values above 0.95 increase false negatives on low-contrast checkmarks. Default 0.85 if not specified. |
[OUTPUT_SCHEMA] | JSON Schema describing the expected output structure for per-checkbox state, bounding box, and confidence | {"type":"object","properties":{"checkboxes":{"type":"array"}}} | Validate as valid JSON Schema draft-07 or later. Must include required fields: id, state, bbox, confidence. Reject schemas missing confidence field if downstream system requires it. |
[DOCUMENT_TYPE_HINT] | Optional string describing the form type to help the model disambiguate checkbox styles | insurance-claim-form-acme-2024 | Free text. Used to activate type-specific heuristics for checkbox appearance. Null allowed. Avoid PII in hint value. |
[PREPROCESSING_NOTES] | Optional array of strings describing any image preprocessing already applied | ["deskewed","contrast-enhanced","grayscale"] | Accepted values: deskewed, contrast-enhanced, grayscale, denoised, binarized, rotated-90, rotated-180, rotated-270. Informs model about artifact risk. Null allowed. |
Implementation Harness Notes
How to wire the checkbox detection prompt into a production document processing pipeline with validation, retries, and human review.
The checkbox detection prompt is designed to be called once per page image or per document region containing candidate checkbox fields. In a production pipeline, you should first run a form field detection or region proposal step to identify candidate checkbox locations, then invoke this prompt on each cropped region or on the full page with bounding box references. This two-stage approach reduces token usage and improves accuracy by giving the model focused visual context. For high-throughput pipelines processing thousands of forms per day, batch multiple checkbox regions into a single prompt call where possible, but keep each batch under 8-10 checkboxes to avoid attention dilution across distant regions.
Wire the prompt into your application with a validation layer that checks the output schema before accepting results. Every checkbox classification must include a state field (one of checked, unchecked, indeterminate), a confidence score between 0.0 and 1.0, and bounding_box coordinates normalized to the input image dimensions. Reject outputs that contain states outside the allowed enum, confidence values outside the valid range, or bounding boxes that fall outside the image boundaries. For indeterminate classifications, require the model to include an indeterminate_reason field (e.g., obscured, partial_mark, low_contrast, ambiguous) to support downstream routing decisions. Implement a retry strategy with exponential backoff: if validation fails, resubmit the same input with the validation error message appended as a correction instruction. After two failed retries, route the region to a human review queue rather than looping indefinitely.
For model selection, use a vision-capable model that supports structured output with bounding box spatial reasoning. GPT-4o, Claude 3.5 Sonnet, and Gemini 1.5 Pro are suitable for this task. Avoid text-only models that require pre-extracted OCR coordinates, as checkbox state detection depends on visual features like mark density, fill pattern, and spatial relationship to the box boundary that OCR pipelines often lose. If you must use a text-only model, preprocess images with a dedicated object detection model to extract checkbox regions and visual features, then pass those features as structured context rather than relying on the LLM to interpret raw coordinate strings.
Logging and observability are critical because checkbox detection failures cascade into form completeness decisions. Log every invocation with: the input image hash or document ID, the prompt version, the model and temperature used, the raw output, validation pass/fail status, retry count, and the final accepted or rejected classification. For checkboxes routed to human review, log the reviewer's correction to build a feedback dataset for future prompt improvements or fine-tuning. Implement a confidence threshold in your application layer: classifications with confidence below 0.85 should trigger human review automatically, while those above 0.95 can proceed through automated pipelines. The 0.85-0.95 band should include a sampled review (e.g., 10% of cases) to monitor for drift.
Failure modes to instrument for include: false positives on printed box borders that resemble checkmarks in low-resolution scans, false negatives on light pencil marks or faded ink, and confusion when a checkmark from an adjacent field extends into the target checkbox boundary. Add eval assertions that specifically test these cases: include test images with printed decorative borders near checkboxes, faint marks at varying opacity levels, and densely packed checkbox grids where marks from neighboring fields bleed into target regions. Run these evals on every prompt change before deployment. For regulated use cases such as insurance claims, government forms, or medical intake, always require human confirmation on any checkbox classified as checked or indeterminate before the form proceeds to downstream processing—never treat the model's classification as ground truth in high-stakes workflows.
Expected Output Contract
Defines the required JSON structure, field types, and validation rules for the checkbox detection response. Use this contract to build post-processing validators and integration adapters.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
checkboxes | array | Must be present and non-null. Empty array allowed if no checkboxes detected. | |
checkboxes[].id | string | Unique identifier per checkbox instance. Must be stable across re-detection of the same document. | |
checkboxes[].state | enum: checked, unchecked, indeterminate | Must be one of the three allowed values. Reject any other string. | |
checkboxes[].confidence | number (0.0-1.0) | Must be a float between 0 and 1 inclusive. Values below [CONFIDENCE_THRESHOLD] should be routed for human review. | |
checkboxes[].bounding_box | object | Must contain x, y, width, height as positive numbers. Coordinates normalized to page dimensions. | |
checkboxes[].page | integer | 1-indexed page number. Must be greater than 0 and not exceed total page count of [DOCUMENT]. | |
checkboxes[].label | string or null | Associated text label if detected within proximity. Null allowed when no label is found. | |
checkboxes[].evidence | string | Brief description of visual evidence for the state classification. Required when confidence is below [HIGH_CONFIDENCE_THRESHOLD]. |
Common Failure Modes
Checkbox detection fails in predictable ways. These are the most common production failure modes and the specific guardrails that prevent them.
False Positives on Printed Box Borders
What to watch: The model classifies empty printed square borders as checked boxes, especially when borders are thick, dark, or adjacent to filled fields. This is the most common failure in dense forms with many empty checkboxes. Guardrail: Add explicit negative examples of empty bordered squares in few-shot prompts. Require a minimum fill-ratio threshold (e.g., >15% of bounding box area contains mark pixels) before classifying as checked. Post-process with a rule-based check that rejects checked classifications when the interior pixel density is below threshold.
Checkmark Bleed into Adjacent Fields
What to watch: A large or sloppy checkmark extends beyond its target box into a neighboring checkbox region, causing the model to classify both as checked. This is especially common in handwritten forms with small checkbox spacing. Guardrail: Implement bounding box overlap detection in post-processing. When two adjacent boxes are both classified as checked, compare confidence scores and mark proximity. If one box has significantly lower confidence and its region overlaps with a higher-confidence checked neighbor, flag for human review rather than accepting both classifications.
Low-Contrast Scan Misclassification
What to watch: Faint pencil marks, light pen strokes, or washed-out scans cause the model to miss checked boxes entirely or classify them as unchecked. The failure is silent—no low-confidence flag is raised because the model simply doesn't see the mark. Guardrail: Pre-process images with adaptive contrast enhancement before inference. Set a lower confidence threshold for checked classification than for unchecked, and route any checkbox with confidence between 0.4 and 0.7 to a human review queue with the cropped region attached. Log all low-contrast inputs for threshold calibration.
Indeterminate State Collapse to Binary
What to watch: The model forces a checked/unchecked decision on boxes that are genuinely indeterminate—partially filled, crossed out, erased, or containing ambiguous marks. This hides uncertainty that downstream systems need to act on. Guardrail: Require the prompt to output a three-state enum: checked, unchecked, indeterminate. Provide few-shot examples of each indeterminate case (cross-out, partial fill, erasure, smudge). Add an eval check that verifies the model uses the indeterminate class at least once on a test set containing known ambiguous boxes.
Checkbox Group Context Ignored
What to watch: In radio-button groups or mutually exclusive checkbox sets, the model checks multiple options where only one is valid, or misses that a "select all that apply" group permits multiple selections. The model treats each box independently without group-level reasoning. Guardrail: Include group context in the prompt by describing the form instruction text associated with each checkbox group. Add a post-processing validation rule: for radio-button groups (single-select), flag any output with more than one checked box. For "select all" groups, flag when zero boxes are checked if the field is required.
Scanned Artifact Confused with Intentional Mark
What to watch: Scanner noise, bleed-through from reverse-page content, staple holes, hole punches, or page creases are classified as checked boxes. These artifacts often appear in consistent positions across pages, making them look systematic. Guardrail: Add artifact-specific negative examples in few-shot prompts showing staple holes, punch holes, and bleed-through. Implement a cross-page consistency check: if the same coordinate region is classified as checked on multiple consecutive pages, flag as probable artifact. Use a separate artifact-detection pre-pass before checkbox classification on low-quality scans.
Evaluation Rubric
Use this rubric to test checkbox detection output quality before shipping. Each criterion targets a known failure mode in production form processing pipelines. Run these checks against a golden dataset of at least 50 annotated form pages spanning clean scans, low-contrast documents, dense checkbox grids, and forms with printed border artifacts.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Checked vs. Unchecked Classification Accuracy | F1 score >= 0.95 on clean digital forms; >= 0.90 on scanned forms at 200 DPI or higher | Checked boxes classified as unchecked (false negative) or empty boxes classified as checked (false positive) on more than 5% of fields in the test set | Run per-checkbox classification against human-annotated ground truth. Compute precision, recall, and F1 per document quality tier. Flag any form where error rate exceeds 10% for manual review. |
Printed Border False Positive Rate | False positive rate < 2% on forms with printed box borders, decorative frames, or table cell outlines | Model reports checked state for empty boxes that have thick, dark, or stylized printed borders. Common in government forms and legacy scanned documents | Curate a test subset of 20+ forms with prominent printed borders but no actual checkmarks. Count false positives. If rate exceeds 2%, add border-only negative examples to few-shot demonstrations or adjust confidence threshold. |
Adjacent Field Interference | Zero cross-field contamination: a checkmark in field A must not cause field B to be classified as checked | Checkmark from one box bleeds into bounding box of adjacent checkbox, causing false positive. Most common in dense checkbox grids with small spacing | Create test cases with single checked boxes surrounded by unchecked neighbors in tight grids. Verify only the correct box is classified as checked. Measure bounding box overlap precision at IoU >= 0.85 with ground truth. |
Low-Contrast Scan Handling | Recall >= 0.85 on documents scanned at 150 DPI with faded ink, light pencil marks, or gray checkmarks | Checked boxes missed entirely (false negative) when checkmark contrast is low relative to paper background. Silent failure that propagates missing data downstream | Assemble a low-contrast test set with varying mark darkness. Measure recall separately from high-contrast cases. If recall drops below 0.85, add explicit low-contrast handling instructions to the prompt or route low-confidence outputs to human review. |
Indeterminate State Detection | Indeterminate boxes (partially filled, crossed out, erased, or ambiguous) are flagged with state=indeterminate and confidence < 0.80 | Indeterminate boxes classified as checked or unchecked with high confidence. Erased marks, strike-throughs, and partial fills are the most common sources | Include 15+ indeterminate examples in the test set (erased marks, X marks, half-filled boxes, smudged checks). Verify state field equals indeterminate and confidence score is below 0.80. If not, add indeterminate examples to few-shot prompts. |
Bounding Box Coordinate Accuracy | IoU >= 0.85 between predicted bounding box and ground truth for all detected checkboxes | Predicted bounding box shifts to adjacent field, clips the checkmark, or expands to cover multiple boxes. Causes downstream extraction to associate wrong field values | Compute Intersection over Union for every predicted bounding box against ground truth annotations. Flag any box with IoU < 0.70 for review. Test on rotated forms (up to 5 degrees) and skewed scans to verify coordinate stability. |
Confidence Score Calibration | Checked boxes: confidence >= 0.90. Unchecked boxes: confidence >= 0.90. Indeterminate: confidence < 0.80. No high-confidence errors | High-confidence misclassifications (confidence > 0.90 but wrong state). Indicates model is overconfident on failure patterns it hasn't seen | Plot confidence distributions per true state. Check for high-confidence errors in the confusion matrix. If any misclassification has confidence > 0.90, add that example to the test suite and consider confidence threshold adjustment or routing to human review. |
Multi-Page Consistency | Same checkbox field tracked across pages maintains consistent state. No duplicate detections or state conflicts | Checkbox spanning page breaks is detected twice with conflicting states, or field on page 2 is missed entirely. Breaks form completeness rollups | Include 5+ multi-page forms in the test set with checkbox fields that continue across pages. Verify page-span identifiers are consistent and state matches across pages. Check for duplicate bounding box detections at page boundaries. |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a frontier model and relaxed output validation. Start with a single-page PDF containing 5-10 checkboxes of varying states. Remove strict schema enforcement initially to observe raw model behavior.
Add to the prompt:
code[CONSTRAINTS] - Accept approximate bounding boxes - Allow confidence as a rough estimate (high/medium/low) - If a checkbox state is truly ambiguous, classify as "indeterminate"
Watch for
- Model hallucinating checkboxes that don't exist (false positives on bullet points, logos, or decorative squares)
- Confidence scores that are uniformly high without genuine uncertainty calibration
- Bounding box coordinates that exceed page dimensions or overlap incorrectly
- Printed checkmark symbols inside boxes being classified as "checked" when the box itself is empty

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us