Heh...
I must be missing something. Whether you know the I.D. or the O.D. it doesn't matter cause what you really need to know is the thickness of the wall of the pipe.
Say you have a pipe that is 2" in diameter. The thickness of the wall is 1/8". That would make the interior diameter 1 3/4".
Too simple, so I must be missing some key information.
Maybe you're looking for some code that figures this out.