Patent term calculation is complicated in the US because there are essentially two different systems and quite a few corner cases. Even with a list of patents, it can be tricky to determine when the patents are all expired. Since I am a computer programmer (and not a lawyer), I created a program to try and automate this. This paper discusses how patent term calculation works, and some results from a combination of hand and automatic term calculation for MP3, MPEG-2 and H.264.