What is the Vibration API?

The Vibration API (navigator.vibrate()) is a browser standard that lets web pages trigger the physical vibration motor built into smartphones and some tablets. It accepts either a single duration in milliseconds or an alternating array of vibrate/pause durations — called a vibration pattern. The API is supported in most Android browsers; iOS does not expose vibration to web pages due to platform restrictions.

Vibration patterns are described as arrays where odd-indexed values represent vibrate durations and even-indexed values represent pause durations. For example, [200, 100, 200] means vibrate 200 ms, pause 100 ms, vibrate 200 ms. Calling navigator.vibrate(0) or navigator.vibrate([]) cancels any ongoing vibration immediately.

Tool description

This tool lets you test whether your device supports the Vibration API and experiment with vibration patterns directly in the browser. You can trigger a single pulse with a configurable duration, enter a fully custom comma-separated pattern, or choose from built-in presets such as SOS, heartbeat, and double/triple pulses. An event log records every vibration attempt with a timestamp and the exact pattern used, so you can compare results across different devices and browsers.

Examples

Pattern input What happens
300 Single pulse lasting 300 ms
200,100,200 Vibrate 200 ms → pause 100 ms → vibrate 200 ms
150,100,150,100,150 Three short pulses with 100 ms gaps between them
0 Cancels any ongoing vibration

Features

  • Detects whether the device and browser support the Vibration API and displays the status on load
  • Adjustable single-pulse duration from 10 ms to 5000 ms via a slider
  • Custom pattern input accepts any comma-separated sequence of vibrate and pause durations
  • Six ready-to-use presets: Short Pulse, Long Pulse, Double Pulse, Triple Pulse, SOS Pattern, and Heartbeat
  • Event log with timestamps showing every triggered pattern and whether it was accepted or rejected by the browser

Use cases

  • Mobile web development: Verify that haptic feedback implemented with the Vibration API actually fires on a target device before shipping the feature.
  • QA device testing: Quickly confirm the vibration motor works on a freshly received or repaired smartphone without installing a native app.
  • Pattern prototyping: Iterate on custom vibration sequences (notification alerts, game feedback, accessibility cues) by testing them live in the browser.

How it works

The tool calls navigator.vibrate(pattern) with the value you provide. The browser returns true if the call was accepted and false if it was rejected — for example, because the document is not focused or the device does not support the API. Both outcomes are recorded in the event log. All processing happens entirely on-device; no data is sent to any server.

Limitations

  • iOS (Safari, Chrome on iOS): Apple does not expose navigator.vibrate() on iOS, so the API is always reported as unsupported on iPhones and iPads.
  • Desktop browsers: Desktop computers generally have no vibration motor, so even when the API is available it has no physical effect.
  • Background tabs: Some browsers silently reject vibration calls when the page is not in the foreground.
  • Maximum duration: Individual vibration segments are capped by the browser (commonly around 10 seconds); very large values may be silently truncated.