Telephone numbers in the United Kingdom have a flexible structure that reflects their historical demands, starting from many independent companies through a nationalised near-monopoly, to a system that supports many different services, including cellular phones, which were not envisaged when the system was first built. Numbers evolved in a piecemeal fashion, with numbers initially allocated on an exchange-by-exchange basis for calls connected by manual operators. Subscriber numbers reflected demand in each area, with single digit telephone numbers in very rural areas and longer numbers in cities.

Beginning with London's director system, a need to automate telephone dialling resulted in every exchange being allocated either a unique Subscriber Trunk Dialling (STD) code or unique range of numbers within a wider dialling code area. For many years, calls dialled between nearby exchanges often required 'local codes' to select the most direct call route, rather than dialling the STD codes.

Demand for telephone lines has grown and exchanges have been modernised, so many subscriber numbers have been lengthened and highly localised STD codes have been rationalised into wider area codes. Such was the demand for lines in London that the city's telephone area was first split into two separate dialling codes, before being merged again with a short dialling code and long subscriber numbers. Meanwhile, a need to find numbers for special services, such as mobile telephones and information services, initially led to confusion with traditional telephone numbers.

From 1995, extensive renumbering exercises have led to specific number ranges being allocated to distinguish between traditional 'geographic' telephone numbers, mobile numbers and special services. Despite these rationalisations, there remains no standard format or length for a UK area code or telephone number, and there are misunderstandings in code areas which have seen alterations to customers' individual telephone numbers.

Origins The telephone service in the United Kingdom was originally provided by private companies and local councils. But by 1912–13 all except the telephone service of Kingston upon Hull and Guernsey had been bought out by the Post Office. The Post Office also operated telephone services in Jersey until 1923 and the Isle of Man until 1969 when the islands took over responsibility for their own postal and telephone services – although the Isle of Man system remained part of British Telecom until 1987.

Post Office Telecommunications was reorganised in 1980–81 as British Telecommunications (British Telecom, or BT), and was the first major nationalised industry to be privatised by the Conservative government. The Hull Telephone Department was itself reconstituted as Kingston Communications, in 1987; it was sold by Hull City Council in the late 1990s and celebrated its centenary in 2004.

Subscriber numbers From the introduction of the telephone in the late 1870s, to the early 1990s, telephone numbers in most of the United Kingdom were usually shown with a written exchange name followed by the subscriber number, e.g. 'Mallaig 10' or 'Aberdeen 43342'. This allowed calls to be placed initially through the operator and later by using local or national dialling codes. Exchange names were usually closely tied to the physical location of telephone exchanges, being either the name of a city, town or village or district.

The length of early telephone numbers depended on the number of subscribers attached to a particular exchange: if there were fewer than 10 subscribers, a single digit sufficed. One single-digit number survived in Rèinigeadal, Scotland until 1990. Two-digit numbers were sufficient on small exchanges with fewer than 100 subscribers, while exchanges with a few hundred lines used three-digit subscriber numbers, e.g. 200–499. Larger exchanges which covered thousands of lines used four-digit subscriber numbers, e.g. 2000–5999, or five-digit subscriber numbers, e.g. 20000–49999.

As demand for telephones grew, more telephone numbers were required. This would often see an exchange with existing three-digit numbers open one or more new ranges with four-digit local numbers (e.g. 5000-6999), and exchanges with existing four-digit numbers open one or more new ranges with five-digit local numbers (e.g. 60000–69999). This piecemeal approach lasted until the 1980s when a shortage of numbers resulted in an overhaul of dialling codes and subscriber numbers.

As of 2020, 52 exchanges still have five-digit subscriber numbers of which a dozen places also have unusually long STD codes. One area with a long STD code retains four-digit local numbering (see Telephone Numbers in the United Kingdom for examples).

Director system

In November 1922 the General Post Office decided to adopt the Strowger system after trialling several automatic exchange systems; initially for small and medium towns and cities in Britain. But for London this required development of the Director telephone system by the Automatic Telephone Manufacturing Company (ATM) to enable operation with a mixture of both automatic and manual local exchanges in the London area for several decades. A demonstration model of a "Director" exchange was shown by the developer ATM of Liverpool as part of the Post Office exhibits at the British Empire Exhibition at Wembley in 1924 and 1925. However, it was not until 1927 that the first "Director" telephone exchange was brought into service in Holborn, London and rolled out progressively across Greater London. Letters were assigned to each number from 2 to 0 on the telephone dial—in a different scheme than that currently used—and a three-digit code, represented by letters, identified the local exchange. Telephone numbers were displayed preceded by the exchange name, with the first three letters highlighted to indicate the code, and number, such as WHItehall 1212.

Director schemes were gradually introduced in other major cities, Birmingham, Edinburgh, Glasgow, Liverpool and Manchester.

Introduction of area codes and local dialling codes in non-director areas Following successful trials of Rural Automatic Exchanges (RAX) from 1921, standardised automatic exchanges were gradually introduced to smaller towns and rural areas. Each RAX was connected to a 'parent' exchange in a larger town. At first, RAX exchanges only allowed subscribers to dial numbers on the same exchange: for numbers on other exchanges, subscribers had to dial '0' (or occasionally '01') to call an operator at a manual switchboard in the parent exchange. Later RAX exchanges introduced direct dialling to parent automatic exchanges by dialling '9' followed by the subscriber number, and direct connections to manual operators at other nearby exchanges by dialling 6, 7 or 8. This set the pattern for later local codes.

'Large multichange exchange areas' were developed from 1925 to allow several 'satellite' exchanges within provincial cities to be connected to a main exchange, using different number ranges for each exchange without separate dialling codes. This has become known as a linked numbering scheme.

The installation of Unit Automatic Exchanges (UAX) from 1937 introduced local dialling codes for the first time outside the Director areas: subscribers could now directly dial calls to and from nearby automatic exchanges using short dialling codes. Unlike Director codes or modern dialling codes, the code for a specific destination would vary from exchange to exchange: for example, the local code for Totnes was 997 from Bigbury, but 882 from Blackawton and 86 from Paignton. Trunk calls (long-distance calls beyond the local call charging area) still required connection by an operator.

Introduction of STD codes

Subscriber Trunk Dialling (STD) was introduced in 1958 to allow subscribers to dial trunk calls without operator assistance. Uniform exchange codes, usually called STD codes, were allocated for every exchange in the country progressively as STD was rolled out. This process was not completed until 1979.

Change to Operator number In order to allow STD codes to begin with a uniform '0', the number used to call the operator was changed from '0' to '100' as STD was rolled out.

STD codes for director areas The existing director areas were allocated a short area code, usually in the form 0x1 (01 for London). These were: Area code City Notes 01 London Until 1990—see below 021 Birmingham (2 = B) 031 Edinburgh (3 = E) 041 Glasgow (4 = G) 051 Liverpool (5 = L) 061 Manchester (6 = M)

The codes 071, 081, and 091 were reserved for later expansion, with 071 being planned for Sheffield (7 = S). The former two were eventually temporarily allocated to London (see below).

Within the director areas, the first three digits of the seven digit subscriber number would relate to the local telephone exchange on which the number could be found. Before all-figure dialling, these were usually three-digit letter codes, based on the first three letters of the exchange name. For example, within the Liverpool director area, a number on the Anfield telephone exchange would be dialled as ANField xxxx and the number would be dialled by STD as 051 ANF xxxx. After the advent of all-figure dialling the number would be 051 263 xxxx.

Creation and numbering of new STD code groups Nearly 6000 exchanges needed to be assigned STD codes. In order to simplify the numbering, and to allow for future consolidation, exchanges were linked into just over 700 charge groups. Each charge group was assigned to a Group Switching Centre (which might handle more than one charge group) and allocated a four digit code. Where a town had its own GSC, the four digit code served as the STD code for this 'core' town. Smaller 'ring' or satellite exchanges in each group were initially assigned individual dialling codes based on the charge group's code.

The original concept was for there to be a nationwide Director system, and in common with the Director system, Group Switching Centres were originally based in major towns and assigned codes based on two letters of the respective place's name and the corresponding numbers on a telephone dial. The letters and numbers originally corresponded as follows on a UK telephone (note that US and modern UK telephones use a different allocation of letters to numbers): 1234567890ABCDEFGHIJKLMNPRSTUVWXYO For example Aylesbury was given the STD code 0AY6, where the letter A can be found on the number 2 and the letter Y on the number 9. The letter O became a zero, such as for Bournemouth: 0BO2 where BO = 20. To help the public remember the new codes they were initially advertised using this alphanumeric combination of 0 followed by two letters and at least one number. From 1966 all STD codes were displayed as numbers only.

Originally, where a place's name began with the letter "O" the code would begin with two zeros, such as Oxford: 0OX2 where OX = 09. These codes starting with "00" were later reallocated, freeing the prefix 00 for use by calls to the Republic of Ireland, to radiophones and to premium rate numbers.

Dialling within STD exchange groups and conversion to linked numbering areas Some charge groups used a single STD code and then used distinct subscriber number ranges to route calls to the correct local exchange, such as 2xxxx for numbers on one exchange and 5xxxx for numbers on another, known as a linked numbering scheme. However, in most areas further codes were needed to route calls to the correct exchange within the charge group both for STD and local calls. Different codes were used for STD and local dialling. Because of this, telephone numbers were usually still stated with the exchange name and subscriber number, e.g. 'Blackawton 299', to allow callers to look up the appropriate code for their call.

Local dialling codes