Disconnecting the battery usually clears pending and confirmed OBD2 codes and resets readiness monitors to “not ready,” the same way a scan tool’s clear-codes command does. Permanent codes don’t clear this way: federal and California OBD II regulations require them to survive a power loss so drivers can’t bypass an emissions test.
- Regular stored/confirmed codes and readiness monitors usually reset when you disconnect the battery, the same as using a scan tool’s clear-codes function.
- Permanent codes are different by design. CARB and EPA regulation requires them to be written to non-volatile memory that survives a power loss, specifically so a battery disconnect can’t be used to fake a passed emissions test.
- Learned values like idle speed, throttle position, and fuel trim live in the same battery-backed memory as regular codes, so a disconnect can make the engine idle or run a little rough until the computer relearns them.
- A cleared code is not a repair. If the underlying fault is still there, it comes back once the related monitor reruns and detects it again.
- A scan tool’s “clear codes” command resets the same data a battery disconnect does, but it leaves learned idle and fuel-trim values alone and doesn’t touch your radio presets or clock.
What Actually Happens Inside the Computer When You Cut the Power?
Your vehicle’s engine computer stores different kinds of data in different types of memory, and that’s the whole reason the answer to this question isn’t a simple yes or no. Some data lives in memory that only holds its contents while power is flowing to it. Other data is written to non-volatile random access memory, or NVRAM, which keeps its contents even after power is cut.
California’s OBD II regulation defines NVRAM specifically as memory that “retains its contents even when power to the on-board control unit is interrupted.” That single technical detail explains almost everything else in this article: whatever type of code or value sits in NVRAM survives a battery disconnect, and whatever doesn’t, generally does not.

Do Pending and Confirmed Codes Get Cleared?
Yes, in most cases. Pending and confirmed diagnostic trouble codes are not required to be stored in NVRAM, so they typically live in memory backed by the vehicle’s ignition and battery power. When you disconnect the battery long enough to drain that backup power, the codes stored there are lost, and the check engine light goes off.
This is functionally the same result you’d get from using a scan tool’s “clear codes” command. If you’re still getting familiar with what a scan tool shows you, our first-time OBD2 scanner guide covers where pending and confirmed codes show up on a typical scan.

The catch is that clearing a code, whether by battery disconnect or scan tool, does nothing to fix whatever triggered it. If the fault is still happening, the same monitor will detect it again on a later drive and set the code right back. Our guide on why the check engine light comes back after clearing a code walks through the typical timeline for that to happen.
Why Permanent Codes Don’t Clear This Way
Permanent codes are the exception, and they’re the reason so many articles on this topic contradict each other. A permanent code is stored at the same time as a confirmed code, but it’s written into NVRAM specifically because regulators wanted a type of code that a battery disconnect, or any scan tool’s clear command, cannot erase.
The California Bureau of Automotive Repair put it plainly in a 2018 workshop presentation on permanent diagnostic trouble codes: permanent codes “cannot be erased by DTC code clearing or battery disconnect.” The presentation also states the regulation’s purpose directly — permanent codes exist to prevent a driver or technician from clearing fault memory just to get a vehicle through an emissions test without actually fixing it.
A U.S. EPA technical memo on OBD readiness testing describes the mechanics in more detail: a permanent code is written to NVRAM “at the end of the key cycle” after the check engine light is commanded on, and it can only be erased by the OBD system itself. That happens one of two ways. If no one has cleared codes with a scan tool, the permanent code erases automatically the moment the related monitor confirms the fault is gone and the check engine light turns off on its own, typically after three consecutive clean trips. If someone did clear codes with a scan tool, the permanent code instead waits until that specific monitor reruns at least once and confirms the fault is no longer present.
Permanent codes were phased in across the 2010 through 2012 model years under both the California regulation (13 CCR 1968.2) and the matching federal rule (40 CFR § 86.1806-17), so this mostly applies to 2010-and-newer vehicles. Older vehicles may not support permanent codes at all.
What Happens to Readiness Monitors?
Readiness monitors track whether the OBD system has finished testing a particular emissions component, like the catalytic converter or the oxygen sensors. Each one reports “ready” (complete), “not ready” (incomplete), or “not supported.” Clearing fault memory, whether with a scan tool or a battery disconnect, resets these monitors to “not ready,” because the completion status lives in the same type of memory as the codes themselves.
That matters for anyone heading toward an emissions inspection right after a battery disconnect. The EPA’s guidance on OBD readiness testing notes that a typical gasoline OBD system can re-complete all of its monitors within about two weeks of normal, varied driving, while a diesel system can take eight weeks or longer because several of its monitors depend on particulate filter regeneration cycles. Most states allow one or two monitors to still be “not ready” at test time, but showing up with most or all monitors incomplete right after a disconnect is a common reason vehicles fail an inspection.

In practice, that means a mix of city and highway driving, not just idling in the driveway. Monitors generally need specific combinations of speed, engine temperature, and steady throttle to run their tests, so a few short trips to the store usually aren’t enough to set them all.
What About Idle, Fuel Trim, and Other Learned Values?
This is the piece most articles on this topic skip, and it’s where a battery disconnect behaves differently from a plain scan tool code-clear. Alongside diagnostic codes, the engine computer continuously builds a set of learned adaptive values: idle speed, throttle position reference points, and short- and long-term fuel trim, which compensate for normal wear like a slightly dirty throttle body or injectors that have drifted a little lean or rich over time. These values live in the same type of battery-backed memory as regular codes, not in NVRAM.
A scan tool’s basic “clear codes” command typically does not touch this learned data. A battery disconnect does, because it removes power from the same memory where both the codes and the learned values are held. That’s a real, practical difference between the two methods, even though both reset codes and monitors the same way.
Manufacturer service documentation backs this up. Honda’s own service bulletin 19-026, issued for certain 2017-18 CR-V models, instructs technicians to “reset the throttle position learned values and do the PCM idle learn procedure” as part of a repair that also involves clearing codes and updating software. That’s a direct example of a manufacturer treating learned idle and throttle values as something separate from codes, which needs its own relearn step once it’s been reset.
As a rule of thumb shared across the trade, technicians generally expect a vehicle to idle a little rough, hunt for idle speed, or feel slightly off in throttle response for a short period after a battery disconnect, while the computer relearns these values during normal driving. This isn’t a malfunction; it typically settles out on its own within a handful of trips.
Battery Disconnect vs. Scan Tool Clear Codes: Side by Side
The graphic and table below summarize what a battery disconnect does and doesn’t reset, compared with a scan tool’s clear-codes command, based on the sources above.

| What it is | Reset by a battery disconnect? | Why | What to expect afterward |
|---|---|---|---|
| Pending and confirmed codes | Usually yes | Stored in memory backed only by battery power, not NVRAM | Check engine light goes off immediately, but returns if the fault is still present |
| Permanent codes | No | Required by regulation (13 CCR 1968.2) to be written to NVRAM, which survives a power loss | Stays recorded until the OBD system itself reruns the related monitor and confirms the fault is gone |
| Readiness monitors | Reset to “not ready” | Monitor completion status is tracked in the same memory as the codes it’s tied to | Needs about two weeks of mixed city/highway driving for a gasoline vehicle to re-complete, longer for diesel |
| Learned values (idle, throttle, fuel trim) | Usually yes | Lives in the same volatile, battery-backed memory used for day-to-day engine tuning | Idle or throttle response may feel slightly off for a few trips while the computer relearns |
Is It Safe to Disconnect the Battery?
Disconnecting a battery is routine, low-risk work, but a few standard precautions apply. Turn off the ignition and remove the key before you start, and disconnect the negative (-) terminal first to reduce the chance of a short if a tool touches metal while it’s still attached. Batteries can vent flammable hydrogen gas, so avoid sparks or open flame near the terminals.
Beyond the codes and learned values covered above, a battery disconnect can also reset your radio presets and clock, and on some vehicles the radio may ask for an anti-theft code to reactivate once power is restored. Check your owner’s manual before you start if you’re not sure whether your vehicle has that feature, since losing that code can be its own headache.
Frequently Asked Questions
Will disconnecting the battery turn off the check engine light?
Usually, yes, for pending and confirmed codes, because the light is tied to those codes rather than to a permanent code specifically. But the light comes right back on if the OBD system detects the same fault again, which can happen as soon as your next drive if the underlying problem hasn’t been fixed.
Does disconnecting the battery clear a permanent OBD2 code?
No. Permanent codes are written to non-volatile memory by design, specifically so a battery disconnect (or any scan tool’s clear-codes command) can’t erase them. Only the vehicle’s own OBD system can clear a permanent code, once it reruns the related monitor and confirms the fault is gone.
How long does the battery need to stay disconnected to clear codes?
There’s no official regulatory figure for this, since it depends on how long the module’s residual power takes to fully drain. As a rule of thumb, technicians commonly leave the battery disconnected for at least several minutes to make sure the relevant memory fully loses power, rather than timing it to the second.
Is a battery disconnect the same as using a scan tool to clear codes?
Mostly, but not entirely. Both reset pending and confirmed codes and readiness monitors the same way. A battery disconnect additionally resets learned idle, throttle, and fuel trim values that a basic scan tool clear-codes command typically leaves alone, and it can also reset your radio and clock settings.
Why does my car idle rough after I reconnect the battery?
This is expected. The engine computer lost its learned idle, throttle, and fuel trim values along with the codes, and it needs normal driving to relearn them. Manufacturer service documentation describes this as a standard “idle learn” process; it typically smooths out within a handful of trips.
Sources
- Cal. Code Regs. tit. 13, § 1968.2, Malfunction and Diagnostic System Requirements — 2004 and Subsequent Model-Year Passenger Cars, Light-Duty Trucks, and Medium-Duty Vehicles and Engines — checked November 2026
- Cornell Law School, Legal Information Institute, 40 CFR § 86.1806-17, Onboard diagnostics — checked November 2026
- California Department of Consumer Affairs, Bureau of Automotive Repair, Permanent Diagnostic Trouble Codes, Workshop Meeting Presentation, April 19, 2018 — checked November 2026
- U.S. Environmental Protection Agency, Office of Air and Radiation, Best Practices for Addressing OBD Readiness in IM Testing of Diesel Vehicles Under 14,000 Pounds GVWR, March 7, 2013 — checked November 2026
- American Honda Motor Co., Inc., Service Bulletin 19-026, 2017-18 CR-V: Software Update with A/C Control Unit Replacement, March 5, 2019, archived by the National Highway Traffic Safety Administration — checked November 2026
autoscanguide.com Editorial Team. Last updated: November 12, 2026.



