How to read an OBD-II trouble code
Short answer: Every OBD-II code is five characters. The first letter names the system, the first digit says whether the code is standard across all manufacturers, the third character names the subsystem, and the last two identify the specific fault.
Finding the port
The connector is a trapezoidal 16-pin socket, required by law to be within reach of the driver's seat. On most vehicles it is under the dash on the driver's side, above the pedals or just left of the steering column. Some hide it behind a small removable panel, an ashtray or a coin tray. It is never in the engine bay.
What the five characters mean
Take P0420. The first character is the system: P for powertrain, B for body, C for chassis, U for network and communication. The second character says who defined the code: 0 means it is generic and standardised across every manufacturer, 1 means the manufacturer defined it themselves. The third character identifies the subsystem. The final two digits identify the specific fault within that subsystem.
The subsystem digit, for P0 codes
1 and 2 are fuel and air metering. 3 is the ignition system and misfire detection. 4 is auxiliary emission controls, which covers EGR, evaporative emissions and the catalytic converter. 5 is vehicle speed control and idle. 6 is the computer output circuits. 7, 8 and 9 are transmission. So P0420 reads as: powertrain, generic, auxiliary emissions, fault 20 — the catalyst efficiency test.
Generic does not mean identical
A generic code has the same definition on every vehicle, but not the same likely cause. P0420 on a high-mileage vehicle usually is the converter. On a vehicle that just had exhaust work, it is usually a leak. The code narrows the system; your vehicle's history narrows the cause.
Read the freeze frame before you clear anything
Clearing a code erases the freeze frame with it, along with every readiness monitor. Write down engine speed, load, coolant temperature and fuel trims first. On an intermittent fault that snapshot may be the only evidence you get, and recreating it can take days of driving.
Why the code is not the answer
The computer reports failed tests, not broken parts. Codes name the measurement that went out of range. Working out which of several possible faults produced that measurement is the actual diagnosis, and it is what every code page on this site is built around.