Is It Illegal to Use a Generator to Power Your House?

Running a generator to power your house is legal in every U.S. state, so the real question behind “is it illegal to use a generator to power your house” is how you connect and operate it. Plug a generator into a wall outlet or breaker panel without a transfer switch and you’ve crossed into illegal territory in most jurisdictions, exposed yourself to criminal liability if a utility worker is hurt, and likely voided your homeowners insurance in the bargain. Install it correctly, permit it, and keep it clear of the house, and you’re fine.

The Transfer Switch Is the Line Between Legal and Illegal

The National Electrical Code, which local building codes across the country adopt as their baseline, requires a transfer switch for any generator connected to a home’s electrical system. Article 702 covers optional standby systems, the category most residential generators fall into, and mandates transfer equipment for both fixed and portable standby installations. The switch physically disconnects your house from the utility grid before the generator energizes your circuits.

Skip that disconnect and your generator “backfeeds” into the grid. Your outlet puts out 120 or 240 volts, but the transformer on the pole outside steps that up to roughly 7,200 volts on the distribution lines. A lineworker repairing what they believe is a dead line can be electrocuted. If someone is injured or killed because you backfed a generator, you face potential criminal charges for reckless endangerment, plus civil liability for damages. Even in jurisdictions without a statute that names backfeeding specifically, violating the NEC through your local building code produces the same result.

You have options on how to meet the requirement:

  • A manual transfer switch, where you flip a lever to move between grid and generator power. A few hundred dollars plus installation.
  • An automatic transfer switch, which detects an outage and switches on its own. Standard on permanently installed standby generators.
  • An interlock kit, which physically prevents the main breaker and generator breaker from being on at the same time. Lower cost, but not all local codes accept it, so check first.

Backfeeding also wrecks equipment. If grid power restores while your generator is still connected and out of phase, the two sources fight each other and can destroy the generator and your home’s wiring at once. A transfer switch is cheap next to a rewired house or a lawsuit.

When You Need a Permit

Most jurisdictions require an electrical permit before you install a permanent standby generator or wire a transfer switch into your panel. Permit fees typically run $50 to $200 and the process includes an inspection by a local building official. Skipping the permit isn’t just a fine risk. It can void your homeowners insurance and create title problems when you sell the house.

Portable generators used temporarily during an outage generally don’t need a permit if you’re running extension cords from the generator directly to individual appliances. The permit requirement kicks in the moment you connect the generator to the home’s wiring through a panel, inlet box, or outlet. That’s the line a lot of homeowners miss.

Grounding falls under NEC Article 250, which specifies how the generator’s frame and electrical system must be bonded to your home’s grounding electrode system.1OSHA. Grounding Requirements for Portable Generators Whether the generator qualifies as a “separately derived system” depends on whether the transfer switch opens the neutral conductor, which affects grounding. This is work for a licensed electrician, not a weekend project.

Where You Can Put It

Local zoning ordinances control placement, operating hours, and noise. Rules vary, but the patterns are consistent enough to plan around.

Noise Limits

Residential noise ordinances usually set maximum decibel levels measured at or near the property line, with stricter limits at night. Daytime caps commonly fall between 55 and 65 dB(A), dropping to 45 to 55 dB(A) overnight. Portable generators run anywhere from the mid-50s to mid-80s in decibels. A typical portable unit at 75 dB(A) measured at the generator can easily exceed the limit at your property line, especially after dark. Permanent standby generators with sound-dampening enclosures tend to operate in the 60 to 70 dB(A) range.

Noise violations usually trigger a complaint and a code enforcement citation. Repeated violations can escalate to fines or an order to remove the unit. Some communities grant exceptions during declared emergencies or extended outages, but don’t assume emergency use gets a pass. Read your local ordinance.

Setbacks, Screening, and HOAs

Zoning codes often require generators to sit a minimum distance from property lines, with 5 to 10 feet common for permanent equipment. Some communities require fencing, landscaping, or an enclosure to screen the unit from neighbors and the street. You may also run into restrictions on placing generators in front yards or inside easements.

If you live in a homeowners association, check the CC&Rs. HOA restrictions can be stricter than the municipal code and come with their own enforcement teeth. Some ordinances also restrict fuel types, particularly diesel, because of exhaust visibility and odor.

Carbon Monoxide and Clearance Rules

Roughly 100 people die in the U.S. each year from carbon monoxide poisoning caused by portable generators, according to the Consumer Product Safety Commission’s most recent data.2Consumer Product Safety Commission. CPSC Warns of Deadly Carbon Monoxide Risks and Fires During Power Outages Most of those deaths come from running generators inside homes, garages, basements, or other enclosed spaces.

CPSC guidance is blunt: never operate a portable generator indoors, in a garage, in a crawlspace, or in any enclosed or partially enclosed area, even with doors and windows open or fans running.3Consumer Product Safety Commission. CPSC Safety Alert – Portable Generator Hazards Place portable generators at least 20 feet from any opening in the house (windows, doors, vents) with the exhaust pointed away from the structure.4Consumer Product Safety Commission. Stationary Generators – The Carbon Monoxide Poisoning Hazard Many local building codes have adopted this 20-foot distance as a legal requirement, not just a recommendation.

Permanently installed standby generators must comply with NFPA 37, the standard for stationary combustion engines. The clearances most inspectors check:

  • At least 5 feet from any operable window, door, vent, or wall opening
  • At least 18 inches from a solid rear wall
  • 3 feet of clearance at the front and sides
  • 5 feet of open space above the unit

Most states require carbon monoxide alarms in homes with fuel-burning appliances, fireplaces, or attached garages. A portable generator used outdoors doesn’t technically trigger those statutes, but the risk from any generator near the house makes working alarms essential. Install them on every level and near all sleeping areas, and make sure at least one has battery backup so it works during the outage you bought the generator for.

Fuel Storage

Gasoline, propane, kerosene, and other generator fuels must be stored outside living areas in approved, labeled containers.3Consumer Product Safety Commission. CPSC Safety Alert – Portable Generator Hazards Local fire codes set limits on how much fuel you can keep on residential property without a specialized permit, typically somewhere between 10 and 25 gallons of gasoline depending on jurisdiction. Fueled equipment generally can’t be stored or operated inside a building unless that structure was designed for the purpose under the building code. And never refuel a running or hot generator; fuel spilled on a hot engine is one of the most common causes of generator fires.5Occupational Safety and Health Administration. Using Portable Generators Safely

Insurance: Where Noncompliance Really Hurts

Standard homeowners policies generally cover generator-related property damage and liability, but coverage often hinges on whether the installation meets local code. An insurer can deny a claim if the generator was connected without a required transfer switch, installed without a permit, or operated against the manufacturer’s instructions. If your house burns down because you backfed a generator through a wall outlet, expect the carrier to deny the claim on the grounds that you violated building code.

Three scenarios drive most generator liability claims: fires from improper fuel handling or wiring, carbon monoxide poisoning affecting family members or neighbors, and backfeed injuries to utility workers. Each one puts your code compliance under a microscope.

Review your policy before you install anything. Some insurers require professional installation by a licensed electrician for standby units, and a few offer discounts for code-compliant backup power. A permitted, inspected, professionally installed generator puts you in the strongest position if something goes wrong. Anything less and you may be paying for the damage, plus whatever a court awards to anyone you’ve injured.

Tax Angles Worth Knowing

Two federal provisions can offset part of a generator’s cost. Neither is automatic.

Medical Expense Deduction

If you or a dependent relies on electrically powered medical equipment (an oxygen concentrator, ventilator, or similar device) and a doctor prescribes a backup generator to keep that equipment running, the generator’s cost may qualify as a deductible medical expense. IRS Publication 502 allows deductions for “special equipment installed in a home” and capital improvements whose primary purpose is medical care. The deductible amount is reduced by any increase the improvement adds to your home’s value. If a standby generator adds $5,000 in property value and costs $8,000, the deductible portion is $3,000.6Internal Revenue Service. Publication 502 (2025), Medical and Dental Expenses

The catch: you can only deduct medical expenses that exceed 7.5% of your adjusted gross income, and only if you itemize on Schedule A.7Internal Revenue Service. Topic No. 502, Medical and Dental Expenses On a $75,000 AGI, the first $5,625 of total medical expenses produces no deduction at all. You’ll need a written statement from a licensed healthcare provider confirming the generator is medically necessary.

Business Use of Home

If you run a business from a dedicated home office, a share of the generator’s operating costs (fuel, maintenance, depreciation) can be deducted as part of your home office expenses. The deductible share matches the percentage of your home used exclusively for business. If your office is 10% of the square footage, you can deduct 10% of generator fuel and upkeep.8Internal Revenue Service. Publication 587 (2025), Business Use of Your Home Utilities already qualify under this framework, and generator fuel used to power the home during outages falls into the same category.9Internal Revenue Service. Topic No. 509, Business Use of Home

One boundary worth noting: the Residential Clean Energy Credit under Section 25D, which covered 30% of qualified solar electric systems and battery storage, expired for property placed in service after December 31, 2025.10Internal Revenue Service. Residential Clean Energy Credit If you installed a solar-powered generator or qualifying battery backup before that date, you can still claim the credit on your 2025 return.11Office of the Law Revision Counsel. 26 USC 25D – Residential Clean Energy Credit For 2026 and later, there’s no federal residential clean energy credit for these systems, though some states still run their own incentive programs through their energy offices.