JavaScript Navigator maxTouchPoints Property

Beginner
⏱️ 8 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
Baseline

What You’ll Learn

navigator.maxTouchPoints returns the maximum simultaneous touch contacts the device supports. Learn typical values (0 vs 5), multi-touch checks, gesture UI tips, five examples, and try-it labs.

01

Kind

Read-only property

02

Returns

Number

03

Baseline

Widely available

04

Means

Max touch points

05

Desktop

Often 0

06

Phones

Often 5

Introduction

Touchscreens are not all equal. Some devices track one finger. Others track several at once (pinch-zoom, two-finger scroll, chorded gestures). Your UI should match that ability.

navigator.maxTouchPoints answers with a number: the maximum simultaneous touch contact points the hardware (as reported by the browser) can track. It comes from the Pointer Events family of APIs and is Baseline Widely available.

💡
Capability, not “is this a phone?”

A touch laptop may report 10. A desktop with no touchscreen usually reports 0. Prefer this (and pointer media queries) over fragile user-agent sniffing when adapting gestures.

Understanding the maxTouchPoints Property

Think of it as “how many fingers can the screen track at the same time?”

  • Value — a number (hardware-dependent).
  • Typical desktop0 when there is no touchscreen.
  • Typical phones — often 5 (Android / iOS per MDN).
  • Multi-touch check — MDN uses maxTouchPoints > 1 for richer gestures.
  • Baseline — Widely available across modern browsers (MDN, since about July 2020).

📝 Syntax

General form of the property:

JavaScript
navigator.maxTouchPoints

Value

  • A number: the maximum simultaneous touch contact points supported by the current device.

Common patterns

JavaScript
// Read the count:
console.log(navigator.maxTouchPoints);

// MDN: offer complex multi-touch gestures when possible:
if (navigator.maxTouchPoints > 1) {
  // two/three-finger swipes, pinch-friendly UI…
} else {
  // drag / click / single-finger basics
}

const hasTouch = navigator.maxTouchPoints > 0;

⚡ Quick Reference

GoalCode
Read max touch pointsnavigator.maxTouchPoints
Type checktypeof navigator.maxTouchPoints === "number"
Any touch?navigator.maxTouchPoints > 0
Multi-touch?navigator.maxTouchPoints > 1
Safe defaultnavigator.maxTouchPoints || 0
Status (MDN)Baseline Widely available

🔍 At a Glance

Four facts to remember about navigator.maxTouchPoints.

Returns
number

Max contacts

Baseline
widely

Since ~Jul 2020

No touch
0

Many desktops

Phones
~5

Typical report

📋 maxTouchPoints vs pointer media queries

maxTouchPointsmatchMedia("(pointer: …)")
MeasuresHow many simultaneous touchesPrimary pointer accuracy (fine / coarse / none)
TypeNumberBoolean via MediaQueryList.matches
Best forMulti-touch gesture tiersTouch-friendly vs mouse-first layouts
Combine?Yes — e.g. coarse pointer and maxTouchPoints > 1 → enable pinch UI

Examples Gallery

Examples follow MDN navigator.maxTouchPoints patterns for reading capacity and branching on multi-touch. Prefer Try It Yourself to see your device’s reported count.

📚 Getting Started

Read the count and turn it into a friendly message.

Example 1 — Read Max Touch Points

Log the maximum simultaneous touch contacts the browser reports.

JavaScript
console.log(navigator.maxTouchPoints);
console.log("type: " + typeof navigator.maxTouchPoints);
Try It Yourself

How It Works

The value is a real number. Desktops without touch often show 0; phones often show 5.

Example 2 — Human-Readable Label

Explain the count for a debug panel or “About this device” screen.

JavaScript
const n = navigator.maxTouchPoints;
let label = "no touchscreen (0 points)";
if (n === 1) label = "single-touch (1 point)";
else if (n > 1) label = "multi-touch (up to " + n + " points)";
console.log(label);
Try It Yourself

How It Works

Bucket the number into none / single / multi so UI copy stays clear for beginners.

📈 Practical Patterns

MDN gesture branching, tiers, and adaptive UI modes.

Example 3 — Multi-Touch Gesture Branch (MDN)

Offer richer gestures when the device tracks more than one touch point.

JavaScript
if (navigator.maxTouchPoints > 1) {
  console.log("Offer complex gestures (two/three fingers)");
} else {
  console.log("Offer basic gestures (drag / click / one finger)");
}
Try It Yourself

How It Works

This matches MDN’s recommended pattern: > 1 means multi-touch is available.

Example 4 — Touch Capability Tier

Map the count to a simple none / single / multi strategy object.

JavaScript
function touchTier() {
  const n = navigator.maxTouchPoints || 0;
  let tier = "none";
  if (n === 1) tier = "single";
  else if (n > 1) tier = "multi";
  return {
    maxTouchPoints: n,
    tier: tier,
    allowPinchHints: tier === "multi"
  };
}

console.log(JSON.stringify(touchTier()));
Try It Yourself

How It Works

Store the tier once at startup and reuse it when wiring gesture listeners or help text.

Example 5 — Adaptive UI Mode Helper

Combine touch capacity with a coarse-pointer check for a practical interaction mode.

JavaScript
function interactionMode() {
  const points = navigator.maxTouchPoints || 0;
  const coarse = window.matchMedia("(pointer: coarse)").matches;
  return {
    maxTouchPoints: points,
    coarsePointer: coarse,
    mode: points > 1
      ? "multi-touch"
      : points === 1 || coarse
        ? "touch-friendly"
        : "pointer-first"
  };
}

console.log(JSON.stringify(interactionMode()));
Try It Yourself

How It Works

maxTouchPoints answers “how many fingers?” Media queries answer “what kind of pointer?” Together they guide layout and gestures better than UA sniffing.

🚀 Common Use Cases

  • Gesture tiers — enable two-finger swipe / pinch hints only when > 1 (MDN pattern).
  • Drawing / canvas apps — decide whether multi-touch painting or zoom is realistic.
  • Maps & photo viewers — show “pinch to zoom” only on multi-touch devices.
  • Games — map virtual controls to one finger vs multi-finger chords.
  • Diagnostics — display reported touch capacity in a device info panel.

🧠 How navigator.maxTouchPoints Works

1

Hardware tracks contacts

Touch digitizers support a maximum number of simultaneous points.

Hardware
2

Browser exposes the max

navigator.maxTouchPoints reports that capacity as a number.

Report
3

You branch the UI

Use > 0 / > 1 to choose gesture complexity.

Branch
4

Gestures match the device

Users get controls that their screen can actually handle.

📝 Notes

  • Baseline Widely available (MDN, since about July 2020).
  • Not Deprecated, Experimental, or Non-standard — no status banner required.
  • Hardware-dependent: desktops often 0; many phones often 5.
  • Defined in the Pointer Events specification.
  • Related: mediaCapabilities, hardwareConcurrency, JavaScript hub.

Universal Browser Support

navigator.maxTouchPoints is Baseline Widely available across modern browsers (MDN: since about July 2020). Use it to detect multi-touch capacity for gesture UI.

Baseline · Widely available

Navigator.maxTouchPoints

Read the max simultaneous touch points, branch on > 1 for richer gestures, and keep mouse/pointer paths for 0.

Universal Widely available
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
maxTouchPoints Excellent

Bottom line: Use maxTouchPoints as a capability hint. Pair with pointer media queries for layout; never rely on UA sniffing alone.

Conclusion

navigator.maxTouchPoints tells you how many simultaneous touch contacts the device can track. Read the number, use > 1 for multi-touch gestures (as MDN suggests), and keep simpler pointer interactions when the value is 0 or 1.

Continue with mediaCapabilities, hardwareConcurrency, or the JavaScript hub.

💡 Best Practices

✅ Do

  • Use > 1 before enabling complex multi-touch gestures
  • Treat 0 as “no touchscreen reported”
  • Pair with (pointer: coarse) / fine for layout choices
  • Keep mouse and keyboard paths working on touch devices
  • Test on a real phone and a non-touch desktop

❌ Don’t

  • Assume every phone returns exactly 5
  • Use it alone to detect “mobile” for responsive CSS
  • Hide essential features behind multi-touch only
  • Sniff user-agent strings for touch capability
  • Treat the value as a unique device fingerprint

Key Takeaways

Knowledge Unlocked

Five things to remember about maxTouchPoints

Baseline touch capacity number for multi-touch gesture decisions.

5
Core concepts
👆 02

Means

Max contacts

Touch
🔁 03

Check

> 1 multi

Gestures
💻 04

Desktop

Often 0

Typical
05

Status

Baseline

Wide

❓ Frequently Asked Questions

It is a read-only Navigator property that returns the maximum number of simultaneous touch contact points the current device supports.
No. MDN marks it Baseline Widely available (since about July 2020). It is not Deprecated, Experimental, or Non-standard.
Desktops without a touchscreen usually return 0. Many smartphones (Android and iOS) typically return 5. Touch laptops and tablets often return a positive multi-touch count.
A common MDN pattern is if (navigator.maxTouchPoints > 1) to offer richer gestures (two-finger swipe, pinch-friendly UI). Otherwise keep single-finger or pointer/mouse interactions.
0 means the device reports no simultaneous touch points (often a non-touch desktop). The property itself is still present on modern browsers — the number is simply zero.
No. It is read-only. You read the hardware capability; you cannot change it.
Did you know?

MDN’s classic tip is simple: if navigator.maxTouchPoints > 1, the device can track at least two contacts — a green light for two- or three-finger gesture UX. If not, stick to drag, click, and single-finger basics.

Explore mediaCapabilities Next

Learn how to query decode and encode quality before streaming.

mediaCapabilities →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful