# Electrical code

An electrical code is a term for a set of regulations for the design and installation of electrical wiring in a building. The intention of such regulations is to provide standards to ensure electrical wiring systems are safe for people and property, protecting them from electrical shock and fire hazards. They are usually based on a model code (with or without local amendments) produced by a national or international standards organisation.
Such wiring is subject to rigorous safety standards for design and installation. Wires and electrical cables are specified according to the circuit operating voltage and electric current capability, with further restrictions on the environmental conditions, such as ambient temperature range, moisture levels, and exposure to sunlight and chemicals. Associated circuit protection, control and distribution devices within a building's wiring system are subject to voltage, current and functional specification. To ensure both wiring and associated devices are designed, selected and installed so that they are safe for use, they are subject to wiring safety codes or regulations, which vary by locality, country or region.
The International Electrotechnical Commission (IEC) is attempting to harmonise wiring standards amongst member countries, but large variations in design and installation requirements still exist.

## Regional codes

Wiring installation codes and regulations are intended to protect people and property from electrical shock and fire hazards. They are usually based on a model code (with or without local amendments) produced by a national or international standards organisation, such as the IEC.

### Australia and New Zealand

In Australia and New Zealand, the AS/NZS 3000 standard, commonly known as the "wiring rules", specifies requirements for the selection and installation of electrical equipment, and the design and testing of such installations. The standard is mandatory in both New Zealand and Australia; therefore, all electrical work covered by the standard must comply.

### Europe

In European countries, an attempt has been made to harmonise national wiring standards in an IEC standard, IEC 60364 Electrical Installations for Buildings. Hence national standards follow an identical system of sections and chapters. However, this standard is not written in such language that it can readily be adopted as a national wiring code. Neither is it designed for field use by electrical tradespeople and inspectors for testing compliance with national wiring standards. By contrast, national codes, such as the NEC or CSA C22.1, generally exemplify the common objectives of IEC 60364, but provide specific rules in a form that allows for guidance of those installing and inspecting electrical systems.

#### Belgium

RGIE (fr) (Réglement Général sur les Installations Électriques) is used for installations in Belgium. AREI (nl) (Algemeen Reglement Elektrische Installaties) is used for installations in Flanders, Belgium.

#### France

NF C 15-100 (fr) is used for low voltage installations in France

#### Germany

The VDE is the organisation responsible for the promulgation of electrical standards and safety specifications. DIN VDE 0100 is the German wiring regulations document harmonised with IEC 60364. In Germany, blue can also mean phase or switched phase.

#### Sweden

In Sweden, IEC 60364 is implemented through the national standard SS-436 40 000.

#### United Kingdom

In the United Kingdom, wiring installations are regulated by the British Standard known as BS 7671 Requirements for Electrical Installations: IET Wiring Regulations, which are harmonised with IEC 60364. The first edition was published in 1882. BS 7671 is an industry standard and as such is not itself statutory, however legislation in the form of UK Building Regulations requires that domestic installations conform to a safe standard, and official guidance accompanying this statutory regulation points to following BS 7671 as one way to comply.
BS 7671 is also used as a national standard by Mauritius, St Lucia, Saint Vincent and the Grenadines, Sierra Leone, Singapore, Sri Lanka, Trinidad and Tobago, Uganda and Cyprus.

### North America

The first electrical codes in the United States originated in New York in 1881 to regulate installations of electric lighting. Since 1897 the US National Fire Protection Association, a private non-profit association formed by insurance companies, has published the National Electrical Code (NEC). States, counties or cities often include the NEC in their local building codes by reference along with local differences. The NEC is modified every three years. It is a consensus code considering suggestions from interested parties. The proposals are studied by committees of engineers, tradesmen, manufacturer representatives, fire fighters, and other invitees.
Since 1927, the Canadian Standards Association (CSA) has produced the Canadian Safety Standard for Electrical Installations, which is the basis for provincial electrical codes. The CSA also produces the Canadian Electrical Code, the 2006 edition of which references IEC 60364 (Electrical Installations for Buildings) and states that the code addresses the fundamental principles of electrical protection in Section 131. The Canadian code reprints Chapter 13 of IEC 60364, but there are no numerical criteria listed in that chapter to assess the adequacy of any electrical installation.
Although the US and Canadian national standards deal with the same physical phenomena and broadly similar objectives, they differ occasionally in technical detail. As part of the North American Free Trade Agreement (NAFTA) program, US and Canadian standards are slowly converging toward each other, in a process known as harmonisation.
Mexico and Costa Rica follow the US National Electrical Code.

### South America

Venezuela and Colombia follow the US National Electrical Code.

### India

India is regulated by the so-called Central Electricity Authority Regulations (CEAR).

## Colour coding of wiring by region

In a typical electrical code some colour-coding of wires is mandatory. Many local rules and exceptions exist per country, state, or region. Older installations vary in colour codes, and colours may fade with insulation exposure to heat, light, and aging.

### Europe

From 1970 European countries started a process of harmonising their wiring colours, as several countries had chosen the same colour to denote different wires. The new harmonised colours were chosen mainly because no country had used them. Colours like pink, orange and turquoise were not available as they were deemed to be too close to other colours. Even so, there were unavoidable clashes. Blue was a phase conductor in the United Kingdom and Ireland, which delayed the adoption of the new colours for several decades. But flexible cable was changed pretty much instantly following pressure from manufacturers of appliances.

#### Pre-harmonised European colours

Pre-harmonised single-phase colours by country :
| Country | Line (L) | Neutral (N) |
| United Kingdom Ireland | | |
| Denmark | | |
| Sweden | (L & N Interchangeable) | (L & N Interchangeable) |
| West Germany Austria | | |
| France | | |
| Netherlands | | |
| Belgium | | |
| Switzerland | | |
| Poland | | |
| Italy | | |
| Former Soviet Union | | |

#### Post-harmonised European colours

As of March 2011, the European Committee for Electrotechnical Standardization (CENELEC) requires the use of green/yellow striped cables as protective conductors, blue as neutral conductors and brown as single-phase conductors.
Harmonised single-phase colours :
| Line (L) | Neutral (N) | Protective earth (PE) |
Harmonised three-phase colours :
| L1 | L2 | L3 | Neutral (N) | Protective earth (PE) |
The use of striped green/yellow for earth conductors was adopted for its distinctive appearance to reduce the likelihood of dangerous confusion of safety earthing (grounding) wires with other electrical functions, especially by persons affected by red–green colour blindness.

#### Sweden

In Sweden there is a notable exception for blue, where while the colour normally is used for neutral, it may be used as connecting wire between switches and between switch and fixture, as well as phase wire in a two-phase circuit, all under the condition that no neutral wire is used in the particular circuit.

#### United Kingdom

In the UK it is fairly common practice to use three-core cable with three-phase coloured insulation for part of the wiring of two-way lighting switches. To avoid confusion the accepted practice is to add coloured sleeves to the ends in brown or blue as appropriate to communicate how the wires are being used.

### United States

The United States National Electrical Code requires a bare copper, or green or green/yellow insulated protective conductor, a white or grey neutral, with any other colour used for single phase. The NEC also requires the high-leg conductor of a high-leg delta system to have orange insulation, or to be identified by other suitable means such as tagging. Prior to the adoption of orange as the suggested colour for the high-leg in the 1971 NEC, it was common practice in some areas to use red for this purpose.
The introduction of the NEC clearly states that it is not intended to be a design manual, and therefore creating a colour code for ungrounded or "hot" conductors falls outside the scope and purpose of the NEC. However, it is a common misconception that "hot" conductor colour-coding is required by the Code.
In the United States, colour-coding of three-phase system conductors follows a de facto standard, wherein black, red, and blue are used for three-phase 120/208-volt systems, and brown, orange or violet, and yellow are used in 277/480-volt systems. (Violet avoids conflict with the NEC's high-leg delta rule.) In buildings with multiple voltage systems, the grounded conductors (neutrals) of both systems are required to be separately identified and made distinguishable to avoid cross-system connections. Most often, 120/208-volt systems use white insulation, while 277/480-volt systems use grey insulation, although this particular colour code is not currently an explicit requirement of the NEC. Some local jurisdictions do specify required colour coding in their local building codes, however.

## Color codes

Standard wire insulation colours for alternating current :
| Standard Region or country | Phases (L, L1/L2/L3) | Neutral (N) | Protective earth/ground (PE) |
| IEC 60446 (now part of IEC 60445) European Union from April 2004 United Kingdom from April 2004 (BS 7671) Switzerland from 2005 Argentina Hong Kong from July 2007 Singapore from March 2009 Russia from 2009 (GOST R 50462) Ukraine, Belarus, Kazakhstan South Korea from January 2021 Australia and New Zealand Italy | Prohibited: | [c] [18] | |
| AS/NZS 3000:2018 Australia and New Zealand | Installation wiring: (section 3.8.1) recommended for single phase recommended for multiphase While light blue is prohibited from use for active function, dark blue is recommended for L3. usually used for "Switched Line" To designate any phase, the below colours are prohibited: | | (before 1980) (before 1966) |
| AS/NZS 3000:2018 Australia and New Zealand | Cable identification colours: (section 3.8.3.4) Multiphase cables Current AS/NZS cables | | |
| AS/NZS 3000:2018 Australia and New Zealand | European cables | | |
| AS/NZS 3000:2018 Australia and New Zealand | Single-phase cables Current AS/NZS flexible cords, flexible cables and equipment wiring, and European cables | | |
| AS/NZS 3000:2018 Australia and New Zealand | Superseded AS/NZS flexible cords | | |
| Pre-2004 IEE United Kingdom until April 2006 (BS 7671) India, Pakistan Hong Kong prior to 2009 Malaysia and Singapore prior to February 2011 | | | (before 1977) |
| ABNT NBR 5410 Brazil | Local rules may specify colours to be used for phases. To designate any phase, the below colours are prohibited: | | |
| SABS SANS 10142-1 South Africa | To designate any phase, the below colours are prohibited: | | |
| GB 50303-2015 China (PRC) | | | |
| JIS C 0446 Japan | See ja:識別標識 (電線) for details | | |
| NEC (NFPA 70) United States Mexico (NOM-001) Puerto Rico, Guatemala, Nicaragua, El Salvador, Honduras, Costa Rica, Panama, Dominican Republic, Colombia, Ecuador, Peru, Venezuela | 120, 208, or 240 V 277, or 480 V  metallic brass | 120, 208, or 240 V 277, or 480 V metallic silver | no insulation for isolated systems |
| NEC (NFPA 70) United States Mexico (NOM-001) Puerto Rico, Guatemala, Nicaragua, El Salvador, Honduras, Costa Rica, Panama, Dominican Republic, Colombia, Ecuador, Peru, Venezuela | Flexible cable (e.g., extension, power, and lamp cords) 120 V metallic brass split-phase 240 V | metallic silver | |
| CE Code (CSA C22.1) Canada | for single-phase systems for three-phase systems | | no insulation |
| CE Code (CSA C22.1) Canada | for isolated single-phase systems for isolated three-phase systems | | for isolated systems |
| Boxes (e.g., translucent purple) denote markings on wiring terminals. ↑ The colors in this table represent the most common and preferred standard colors for wiring; however others may be in use, especially in older installations. 1 2 Australian and New Zealand wiring standards allow both Australian and European color codes. ↑ Sweden allow the use of blue for other purposes in circuits without a neutral, for instance two-phase with ground. 1 2 3 Australian-standard phase colors conflict with IEC 60446 colors, where IEC-60446 supported neutral color (blue) is an allowed phase color in the Australia/New Zealand standard. Care must be taken when determining the system used in any existing wiring. ↑ Use of light blue for Neutral may cause confusion with dark blue for L3. In New Zealand domestic installations, the only permitted color for Neutral is black. ↑ Australian and NZ cable identification colours and European cable identification colours should not be combined within the same wiring enclosure. ↑ For safety reasons, yellow should not be used when green/yellow striped cables are present. 1 2 Canadian and American wiring practices are very similar, with ongoing harmonisation efforts. ||||