JavaScript Navigator maxTouchPoints Property

Beginner
5 min read
Updated: Nov 2026
5 examples
Property

Definition

navigator.maxTouchPoints is a read-only Navigator property that returns a number: the maximum count of simultaneous touch contact points the current device supports (MDN / Pointer Events).

Read the notes below before you rely on this property. Prefer feature detection when support is limited.

Syntax

Use navigator.maxTouchPoints. Start with this line.

JavaScript
navigator.maxTouchPoints
CallWhat it does
navigator.maxTouchPointsPrimary signature.

Built into the browser. Read navigator.maxTouchPoints on Navigator — no import required.

Library declarations
JavaScript
navigator.maxTouchPoints

Parameters

ParameterDescription
matchMediaOptional. Coarse pointer / touch-friendly layout

Return Value

Return ValueDescription
*The current value of navigator.maxTouchPoints.

JavaScript Examples

Example 1 — Read the Value

Log navigator.maxTouchPoints and confirm it is a number.

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

How It Works

  1. Read the property. No arguments — just access Navigator.
  2. Expect a number. typeof should be "number".
  3. Accept device variance. Desktops often show 0; phones often show 5.
  4. Do not write to it. Assigning a new value does not change hardware.

Example 2 — Capability Label

Turn the count into a short none / single / multi label.

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

  1. Store the count. One read keeps the branch clear.
  2. Default to none. 0 is the common desktop case.
  3. Check exactly 1. Rare but possible single-touch hardware.
  4. Treat > 1 as multi. Include the max count in the label.

Example 3 — Gesture Branch (MDN)

Offer complex gestures only when the device tracks more than one point.

JavaScript
let msg;
if (navigator.maxTouchPoints > 1) {
  msg = "Offer complex gestures (two/three fingers)";
} else {
  msg = "Offer basic gestures (drag / click / one finger)";
}

console.log(msg);
console.log("maxTouchPoints: " + navigator.maxTouchPoints);
Try It Yourself

How It Works

  1. Use MDN’s threshold. > 1 means multi-touch capable.
  2. Enable richer UX only then. Pinch / two-finger swipe hints.
  3. Fall back otherwise. Mouse, click, or one-finger drag stay primary.
  4. Log the number. Helps students verify the branch on real devices.

Example 4 — Touch Tier Object

Build a small none / single / multi summary for feature flags.

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(), null, 2));
Try It Yourself

How It Works

  1. Normalize with || 0. Keeps math safe if the value is ever falsy.
  2. Map to a tier string. Easier for UI feature flags.
  3. Derive pinch hints. Only when tier is "multi".
  4. Return one object. Handy to log or pass into a settings store.

Example 5 — Interaction Mode Helper

Combine maxTouchPoints with (pointer: coarse) for a simple UI mode.

JavaScript
function interactionMode() {
  const points = navigator.maxTouchPoints || 0;
  const coarse = window.matchMedia("(pointer: coarse)").matches;
  let mode;
  if (points > 1) mode = "multi-touch";
  else if (points === 1 || coarse) mode = "touch-friendly";
  else mode = "pointer-first";

  return {
    maxTouchPoints: points,
    coarsePointer: coarse,
    mode: mode
  };
}

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

How It Works

  1. Read touch capacity. Same hardware number as before.
  2. Query coarse pointer. matchMedia("(pointer: coarse)") hints at finger-sized targets.
  3. Pick a mode. Multi-touch first, then touch-friendly, else pointer-first.
  4. Use for progressive UX. Bigger buttons, optional multi-finger tips — not for fingerprinting.

Browser Support

navigator.maxTouchPoints is Baseline Widely available (MDN). Evergreen browsers have shipped it since about July 2020.

✓ Baseline · Widely available

Navigator.maxTouchPoints

Supported in modern Chrome, Firefox, Safari, Edge, and Opera. Value is hardware-dependent (often 0 on non-touch desktops).

98% Modern browser support
Google Chrome Supported · Desktop & Mobile
Full support
Mozilla Firefox Supported · Desktop & Mobile
Full support
Apple Safari Supported · macOS & iOS
Full support
Microsoft Edge Supported · Chromium
Full support
Opera Supported · Modern versions
Full support
Internet Explorer IE11 supports maxTouchPoints
Partial
navigator.maxTouchPoints Excellent

Bottom line: Safe for modern web apps. Branch on the number (0 / 1 / >1) and keep mouse/pointer UX available when the count is 0.

Frequently Asked Questions

A read-only number: the maximum count of simultaneous touch contact points supported by the current device (MDN / Pointer Events).
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.
MDN’s pattern: if (navigator.maxTouchPoints > 1) offer richer gestures (two-finger swipe, pinch-friendly UI). Otherwise keep single-finger or pointer/mouse interactions.
No. 0 means the device reports no simultaneous touch points (often a non-touch desktop). On modern browsers the property is still present — the number is simply zero.
No. It is read-only. You read the hardware capability; you cannot change it.

Next: mediaCapabilities

Learn how navigator.mediaCapabilities reports decode and encode support.

mediaCapabilities tutorial →

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.

10 people found this page helpful