After the repair

How to clear DTC codes, and when you should not

Clearing a code turns the light off but repairs nothing. What you lose when you clear, why disconnecting the battery is a bad idea and when you should do it.

2 min read Updated November 14, 2026 Reviewed by Renzo Chacca

Guide contents

In short

  • Clearing erases the freeze frame, pending codes and readiness monitor status.
  • Permanent codes cannot be cleared with a scan tool: only a fixed fault removes them.
  • Clear codes after the repair, to check whether the code comes back.
  • Never clear codes in the days before an emissions inspection.

Clearing codes is the most used function on any scan tool, and also the one that causes the most trouble. Turning the check engine light off does not fix the fault, and it erases information you need to find it.

What you lose when you clear codes

  • The freeze frame, the snapshot of engine conditions when the fault occurred: temperature, rpm, load, speed and fuel trims.
  • Pending codes, which warn of faults that have not yet been confirmed.
  • Readiness monitor status, which goes back to not ready. Until the computer completes its tests again, the vehicle cannot pass many emissions inspections.
  • On some vehicles, learned values for fuel mixture and idle.

What a scan tool cannot erase are permanent codes. They only disappear once the computer itself verifies, over a complete drive cycle, that the fault is gone.

When you should clear codes

  1. After the repair, to check whether the code comes back. It is the only way to verify the repair.
  2. When the cause was a one-off and has been fixed, for example a gas cap that was not closed properly.
  3. To separate old codes from current ones, always after you have written down every code and the freeze frame.

How to clear codes properly

  1. Write down or photograph every code, the pending codes and the freeze frame.
  2. With the ignition on and the engine off, use the clear codes function on the scan tool (mode 04 on many tools).
  3. Start the engine and check that the light does not come straight back. If it returns on startup, the fault is still present.
  4. Complete a mixed city and highway drive cycle, then read the codes and monitors again.

What about disconnecting the battery?

It works on many vehicles, but it has side effects: you lose the radio and power window memories and the idle and transmission adaptations, and some vehicles ask for anti-theft codes or recalibrations afterwards. It does not erase permanent codes either. If you have a scan tool, use it.

Clearing codes before an inspection backfires. Clearing codes a few days before an emissions inspection is the surest way to fail it: the monitors are left not ready and the inspection equipment detects it. Fix the fault in good time and drive until the monitors are complete. The guide to preparing for the inspection explains how.

Keep reading

All diagnostic guides