A Piper Archer pilot reported they miscalculated their fuel remaining resulting in a rough running engine due to fuel starvation. They diverted to the nearest suitable airport.
Synopsis
A Piper Archer pilot reported they miscalculated their fuel remaining resulting in a rough running engine due to fuel starvation. They diverted to the nearest suitable airport.
Narrative
I planned a round trip flight from ZZZ to ZZZ1. I went through all my normal preflight planning procedures; which included obtaining a weather briefing; determining the fuel requirement for the round-trip flight; reviewing the POH and utilizing the Foreflight App. This was my first time flying a Piper Archer. Having used Foreflight for the past three years; I have found that it has very good accuracy when it comes to performance predictions. Therefore I determined that I would be able to make the roundtrip flight with more than 45 minutes of fuel remaining upon arriving back at ZZZ; which more than met the minimum VFR fuel reserve requirement per FAR regulations. Upon arriving in ZZZ1; I visually inspected the fuel tanks; and per my estimation; the fuel remaining in both tanks was more than what I had expected and planned for. On the flight to ZZZ1; my groundspeed was higher than anticipated by around 5 knots which also led me to believe that what I was showing inside of the tanks was higher than what I had planned for.On the flight back to ZZZ; I planned to climb up to 10;500 ft. Upon reaching 10;500 ft. I leaned the mixture to peak EGT. About 2 hours into the flight the engine sputtered and my initial reaction was that there was carburetor icing; so I turned the carb heat on. I then noticed that my fuel gauge was reading about 5 gallons; so I decided to switch to the other fuel tank. At this point; the engine restarted and so I realized I had a fuel starvation issue and I immediately started looking for a place to land. I had ZZZ2 in sight before the engine started sputtering again. Once I knew I could make the runway; I [requested priority handling] with Approach; where they asked me if I had ZZZ2 in sight and how many souls I had on board; to which I replied I did and there were 4 souls on board. They gave me the frequency change to the airport and advised me to call them once on the ground. I landed the aircraft safely with no damage to the aircraft or any injury to any of the passengers.From a human performance standpoint; the main issue was an expectation that the plane was to perform better than it did based on calculations from the operating handbook. To prevent a recurrence of this event; I shouldn't fly a single-engine piston aircraft for more than 3 cumulative hours without fueling up. Having a personal minimum as such can standardize the manner in which I fly older general aviation aircraft that might not be relied upon based on their original performance data.
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.