Generate Random UK Phone Number latest version (currently v1.0.0)

← Back to Bookmarklets

For use on: Any Website

This bookmarklet generates a random UK phone number from the ranges specified by Ofcom for use in TV dramas and other creative works. The generated number is automatically copied to your clipboard. The phone number ranges used are those designated by [Ofcom for drama purposes](https://www.ofcom.org.uk/phones-and-broadband/phone-numbers/numbers-for-drama), ensuring the generated numbers are safe to use in documentation, testing, or creative content without risking calls to real phone numbers. When you click this bookmarklet, it will: 1. Select a random phone number range from the approved list 2. Generate a random number within that range 3. Copy the number to your clipboard

Installation

To install this bookmarklet, drag the link below to your bookmarks bar:

Generate Random UK Phone Number

Alternative: Right-click the link above and select "Bookmark This Link" or "Add to Bookmarks".

Script Content

Below is the JavaScript code that runs when you click the bookmarklet:

(function() {
  const ranges = [{
    prefix: '0113 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0114 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0115 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0116 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0117 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0118 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0121 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0131 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0141 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0151 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '0161 496 0',
    min: 0,
    max: 999
  }, {
    prefix: '01632 960',
    min: 0,
    max: 999
  }, {
    prefix: '020 7946 0',
    min: 0,
    max: 999
  }, {
    prefix: '028 9649 6',
    min: 0,
    max: 999
  }, {
    prefix: '029 2018 0',
    min: 0,
    max: 999
  }, {
    prefix: '07700 900',
    min: 0,
    max: 999
  }, {
    prefix: '0808 157 0',
    min: 0,
    max: 999
  }, {
    prefix: '0909 879 0',
    min: 0,
    max: 999
  }, {
    prefix: '0306 999 0',
    min: 0,
    max: 999
  }];
  const range = ranges[Math.floor(Math.random() * ranges.length)];
  const num = Math.floor(Math.random() * (range.max - range.min + 1)) + range
    .min;
  const phoneNumber = range.prefix + num.toString().padStart(3, '0');
  navigator.clipboard.writeText(phoneNumber).then(() => alert('Copied: ' +
    phoneNumber)).catch(() => alert('Failed to copy: ' + phoneNumber));
})();